@ihabdevteam/core 0.363.0 → 0.364.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.
@@ -819,7 +819,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
819
819
  \uC2E0\uB8B0\uB97C \uC313\uACE0
820
820
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",bizNo:"\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638",bizNoValue:"526-81-02926"},Cg={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},gg={phaseWordDownload:"\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC",phaseImageCheck:"\uC774\uBBF8\uC9C0 \uD655\uC778",phasePairAnalysis:"\uB2E8\uC5B4\uC30D \uBD84\uC11D",downloadingCount:"{{n}}\uAC1C \uB2E4\uC6B4\uB85C\uB4DC \uC911",checkingPage:"{{page}}\uD398\uC774\uC9C0 \uBAA9\uB85D \uD655\uC778 \uC911",imageCount:"{{done}} / {{total}}\uAC1C"},bg={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},yg={ariaLabel:"\uC120\uD0DD \uD0ED"},vg={ariaLabel:"\uD0ED"},xg={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},_g={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},wg={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"}},Bg={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",done:"\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",detailFor:"{{name}} \uC0C1\uC138\uBCF4\uAE30"},kg={time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"}},Ag={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},Ng={skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",runs:"{{count}}\uD310"},Eg={resetColumns:"\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654",scrollRegion:"\uAC00\uB85C\uB85C \uAD74\uB9B4 \uC218 \uC788\uB294 \uD45C",rowActionHint:"\uC904\uC744 \uB204\uB974\uBA74 \uC790\uC138\uD788 \uBD05\uB2C8\uB2E4"},Dg={viewWords:"\uB0B1\uB9D0"},Sg={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},jg={chooseDate:"\uB0A0\uC9DC \uC120\uD0DD",selectYear:"\uC5F0 \uC120\uD0DD",selectMonth:"\uC6D4 \uC120\uD0DD"},Tg={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},Mg={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},Lg={place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},$g={clearSelection:"\uC120\uD0DD \uD574\uC81C"},Rg={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Pg={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},Ig={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},Fg={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},Og={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},zg={empty:"\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},Wg={main:"\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8",soft:"\uC18C\uD504\uD2B8",sub:"\uC11C\uBE0C \uCEEC\uB7EC",deep:"\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8",softSub:"\uC18C\uD504\uD2B8 \uC11C\uBE0C",warm:"\uC6DC(\uAC15\uC870)",dark:"\uB2E4\uD06C",radial:"\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8",diagonal:"\uB300\uAC01\uC120 \uD328\uD134",dots:"\uB3C4\uD2B8 \uD328\uD134",outline:"\uC544\uC6C3\uB77C\uC778",success:"\uC131\uACF5/\uC644\uB8CC",naver:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4",instagram:"\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4"},Hg={common:WC,calendar:HC,passCard:VC,rating:qC,colorPicker:UC,dropdown:GC,accordion:KC,header:YC,nav:ZC,settings:XC,usage:JC,account:QC,training:eg,customers:tg,payment:ng,coupons:ag,visits:rg,trainingType:og,myWordTable:sg,keyWords:lg,wordTable:ig,wordSearch:ug,wordPrint:cg,topic:dg,device:pg,manager:mg,wordPairs:hg,footer:fg,date:Cg,wordData:gg,textField:bg,segmentedControl:yg,tabs:vg,fileUpload:xg,avatar:_g,myHomework:wg,trainingStatus:Bg,store:kg,progress:Ag,trainingMiss:Ng,table:Eg,wordScore:Dg,topBanner:Sg,datePicker:jg,report:Tg,tooltip:Mg,phonemeProfile:Lg,bulkBar:$g,debug:Rg,badge:Pg,loader:Ig,soundCompass:Fg,breadcrumb:Og,board:zg,promoBannerBg:Wg},Vg={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",collapseFor:"Collapse {{name}}",expandFor:"Expand {{name}}",sortFor:"Sort {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",discardConfirm:{title:"Discard your changes?",body:"If you do not save, everything you have entered will be lost.",confirm:"Discard"},close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",likeCount_one:"{{count}} like",likeCount_other:"{{count}} likes",selectedOfMax:"{{count}} of {{max}}",downloadCount_one:"{{count}} download",downloadCount_other:"{{count}} downloads",descriptionFor:"About {{name}}",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",playFor:"Play {{name}}",pauseFor:"Pause {{name}}",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",noMatches:"No matching items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},qg={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekLabel:"Week {{ord}}",prevMonth:"Previous month",addOnDate:"Add a visit on {{date}}",nextMonth:"Next month",prevWeek:"Previous week",nextWeek:"Next week",legend:{visited:"Visited",scheduled:"Scheduled",noVisit:"No Show"},periodSelect:"Period unit",visitCount_one:"{{count}} visit",visitCount_other:"{{count}} visits",statusCount:"{{count}} {{label}}",weekOrdinal:["1","2","3","4","5","6","7"]},Ug={planSuffix:"Plan",labeledPlan:"{{label}} Plan",couponCode:"Pass Code",specialLabel:"Open Special",unitDay:"d",unitYear:"yr",remainingDay:"{{n}}d left",remainingHour:"{{n}}h left",remainingMinute:"{{n}}m left",remainingSecond:"{{n}}s left",expired:"Expired",menu:{use:"Activate",refund:"Refund",delete:"Delete"}},Gg={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},Kg={selected:"selected"},Yg={placeholder:"Select"},Zg={collapse:"Collapse",expand:"Expand"},Xg={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},Jg={mainMenu:"Main menu",bottomNav:"Bottom navigation",goToManager:"Go to Malgwi Manager",goToMalgwi:"Go to Malgwi",modeLabelManager:"Malgwi Manager",modeLabelMalgwi:"Malgwi",training:"Training",settings:"Settings",notifications:"Notifications",account:"Account",help:"Help",feedback:"Report a bug",debug:"Debug",coupons:"Coupons",topic:"By Topic",trainingType:"By Training Type",wordPairs:"Word Pairs",wordSearch:"Word Search",wordTable:"Word Table Creator",company:"Company Info",more:"More",moreMenu:"More menu",badgeLabel:"{{label}}, {{count}}",badgeInsideLabel_one:"{{label}}, {{count}} notification inside",badgeInsideLabel_other:"{{label}}, {{count}} notifications inside"},Qg={cache:{cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"}}}},eb={couponButton:"Enter Coupon"},tb={security:{password:{currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."}}},nb={settings:"Settings",filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions_one:"{{n}} question",countQuestions_other:"{{n}} questions",countSentences_one:"{{n}} sentence",countSentences_other:"{{n}} sentences",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",selectInOrder:"Select the cards in the order you heard.",stop:"Stop",preview:"Preview",previewFor:"Preview {{name}}",stopFor:"Stop {{name}}",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",ttsUnavailable:"Speech playback isn't available on this device.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{pendingDone:"Results are still being calculated, so you can't finish yet.",eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",replaySound:"Replay item {{no}}",replaySoundStop:"Stop item {{no}}",done:"Done",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{synthesizing:"Preparing the sound\u2026",preparing:"Preparing sound\u2026"}},ab={totalCount:" customers",loadError:"Failed to load list",device:{title:"Hearing Devices",addButton:"Add device",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",historyTitle:"Hearing device history"},schedule:{registerTitle:" Register Schedule"},visitHistory:{empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"}},rb={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},ob={input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply"},sb={showN:"Show {{n}}"},lb={title:"Training by Type",subtitle:"Select the training type you want",listenInNoise:{title:"Sentence Listening in Noise",desc:"Train sentence comprehension in various noise environments."},shortStory:{title:"Short Story Listening",desc:"Listen to short stories and understand the content."},longStory:{title:"Long Story Listening",desc:"Focus on listening to long stories and grasp the content."},orderingSentence:{title:"Sentence Ordering",desc:"Arrange heard sentences in the correct order."},SAME_SOUND_PICK:{label:"Listen & Pick Same Sound",sub:"Pick the word card that matches what you heard."},SAME_OR_DIFF:{label:"Same or Different?",sub:"Decide whether the two sounds are the same or different."},HEAR_AND_PICK_SAME:{label:"Hear & Match Word",sub:"Pick the word card that matches the sound you heard."},HEAR_AND_PICK_INCLUDED:{label:"Find Word Containing Sound",sub:"Pick the word card that contains the syllable you heard."},STARTS_WITH_SAME_SOUND:{label:"Find Word Starting with Same Sound",sub:"Pick a word that starts with the same sound as what you heard."},LISTEN_AND_REMEMBER_ORDER:{label:"Listen & Recall Order",sub:"Select the cards in the order you heard the three words."},MERGE_2_SYLLABLES:{label:"Combine 2 Syllables",sub:"What word do two syllables make?"},MERGE_3_SYLLABLES:{label:"Combine 3 Syllables",sub:"What word do three syllables make?"},MERGE_2_PHONEMES:{label:"Combine 2 Phonemes",sub:"What sound do two phonemes make?"},MERGE_3_PHONEMES:{label:"Combine 3 Phonemes",sub:"What sound do three phonemes make?"},DROP_1_FROM_2SYLL:{label:"Drop 1 Syllable from 2-Syllable",sub:"What sound remains when you remove a syllable from a 2-syllable word?"},DROP_1_FROM_3SYLL:{label:"Drop 1 Syllable from 3-Syllable",sub:"What sound remains when you remove a syllable from a 3-syllable word?"},DROP_PART_FROM_COMPOUND:{label:"Drop Part of Compound Word",sub:"What word remains when you remove part of a compound word?"},DROP_FINAL_CONSONANT_FROM_1SYLL:{label:"Drop Final Consonant",sub:"What sound remains when you remove the final consonant?"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{label:"Drop Consonant",sub:"What sound remains when you remove the consonant?"},CHANGE_1_SYLL_IN_2SYLL:{label:"Change 1 Syllable (2-Syllable)",sub:"Change one syllable in a 2-syllable word to make a new word."},CHANGE_1_SYLL_IN_3SYLL:{label:"Change 1 Syllable (3-Syllable)",sub:"Change one syllable in a 3-syllable word to make a new word."},CHANGE_1_PHONEME_IN_1SYLL:{label:"Change 1 Phoneme (1-Syllable)",sub:"Change one phoneme in a 1-syllable word to make a new sound."},CHANGE_1_PHONEME_IN_2SYLL:{label:"Change 1 Phoneme (2-Syllable)",sub:"Change one phoneme in a 2-syllable word to make a new word."}},ib={newBadge:"Newly created",publishedBadge:"Published",sharedBadge:"Shared"},ub={title:"Key Words",empty:"No key words available."},cb={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",topInfo:"Header",bottomInfo:"Footer",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount_one:"{{count}} word",itemCount_other:"{{count}} words",deleteAriaLabel:"Delete {{name}}",viewLabel:"View as",sortLabel:"Sort by",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},publisherFilter:"Show only tables by {{name}}",groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",markName:{o:"Correct",triangle:"Partial",x:"Incorrect"},button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap \u25CB \xB7 \u25B3 \xB7 \u2715 under a cell to mark it. With a mouse they appear when you hover the cell; with a keyboard, when focus reaches it.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved_one:"Saved {{count}} mark for {{name}}.",saved_other:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage_one:"Builds a new table from the {{count}} cell {{name}} got wrong or partial. Correct ones are left out.",reviewMessage_other:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated_one:"Created \u201C{{name}}\u201D \u2014 {{count}} cell.",reviewCreated_other:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage_one:"You marked {{count}} cell but have not saved. Leaving discards it.",discardMessage_other:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"},info:{grade:"Grade: {{n}}",syllables:"Syllables: {{n}}",pos:"Part of speech: {{v}}",wordType:"Type: {{v}}"},pos:{noun:"Noun",verb:"Verb",adjective:"Adjective",adverb:"Adverb",numeral:"Numeral",determiner:"Determiner",interjection:"Interjection",particle:"Particle",affix:"Affix",dependentNoun:"Dependent noun",pronoun:"Pronoun",auxVerb:"Auxiliary verb",auxAdjective:"Auxiliary adjective"},reorder:{moved:"Moved to position {{n}} of {{total}}",handle:"Reorder {{word}} (Alt + arrow keys)",hint:"Alt + \u2190 \u2192 to reorder"}},db={filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",gradeNone:"None",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",field:"Semantic Category",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193",original:"Original order"},pageSize:"Show {{count}}",pageSizeAria:"Page size"},pb={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},mb={title:"By Topic",subtitle:"Select a topic to start listening training",noiseTitle:"Sentence Listening in Noise",shortStoryTitle:"Short Story Listening",FOOD:"Food",HLTH:"Health",WETH:"Weather",PRSN:"People",KRCT:"Korean Culture",STRY:"Stories",LOCA:"Locations",SOAR:"Society & Arts",NTSC:"Nature & Science",SPRT:"Sports",sub:{TRKRFD:"Traditional Korean Food",MDKRFD:"Modern Korean Food",WRLDFD:"World Cuisine",MTRFRT:"Ingredients & Fruits",GEFDKL:"Food Facts",HTETHB:"Healthy Eating",DISILL:"Diseases",EXCISE:"Exercise",GEHTKL:"Health Facts",GESSKL:"Seasons",SNWRAN:"Snow & Rain",WTHFCT:"Weather Forecast",GEWTKL:"Weather Facts",JODYPS:"Joseon Dynasty",MDKRPS:"Modern Korea",THKDPS:"Three Kingdoms",WRLART:"World Artists",WRLPSN:"World Figures",KRLANG:"Korean Language",TRPLCT:"Traditional Games",HERITG:"Heritage",EVTFES:"Events & Festivals",GECTKL:"General Knowledge",FRYTAL:"Fairy Tales",AMZING:"Amazing Stories",DAYSTR:"Everyday Stories",KRLDMK:"Korean Landmarks",SELNMK:"Seoul Landmarks",WRDTRB:"World Travel",NAVIGT:"Navigation",KRSOCI:"Korea",ECONEW:"Economy & News",GENART:"Arts",GELFKL:"Life Tips",ANIMAL:"Animals",PLANTS:"Plants",ETHPLT:"Earth",TOLELC:"Tools & Electronics",GESCKL:"Science Facts",INVDSP:"Individual Sports",MARART:"Martial Arts",TEAMSP:"Team Sports",FOOTBL:"Soccer",GESPKL:"Sports Facts"}},hb={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant",other:"Other"}},fb={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"}},Cb={phonemeSelect:{vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",countLabel:"Number of phonemes",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:["Level 1 \u2014 everyday vocabulary acquired before school age and used for life","Level 2 \u2014 difficulty of grades 1\u20132","Level 3 \u2014 difficulty of grades 3\u20134","Level 4 \u2014 difficulty of grades 5\u20136","No level \u2014 frequent everyday words outside the national standard list, plus coinages and loanwords"],selectLabel:"Select",onlyHasImage:"Only words with images",onlySameStructure:"Only same phoneme structure"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},gb={lead:`IHAB builds trust
821
821
  through sound
822
- and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},bb={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},yb={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},vb={clearAriaLabel:"Clear input"},xb={ariaLabel:"Select tab"},_b={ariaLabel:"Tabs"},wb={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Bb={ariaLabel:"User avatar"},kb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Ab={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},Nb={time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"}},Eb={steps:"Step {{current}} of {{total}}"},Db={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},Sb={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},jb={viewWords:"Words"},Tb={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Mb={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},Lb={previewRegion:"Report preview \u2014 scrollable sideways"},$b={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Rb={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Pb={clearSelection:"Clear selection"},Ib={showResult:"Show {{type}} result"},Fb={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Ob={loading:"Loading"},zb={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Wb={ariaLabel:"Breadcrumb"},Hb={empty:"No items yet."},Vb={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},qb={common:Vg,calendar:qg,passCard:Ug,rating:Gg,colorPicker:Kg,dropdown:Yg,accordion:Zg,header:Xg,nav:Jg,settings:Qg,usage:eb,account:tb,training:nb,customers:ab,payment:rb,coupons:ob,visits:sb,trainingType:lb,myWordTable:ib,keyWords:ub,wordTable:cb,wordSearch:db,wordPrint:pb,topic:mb,device:hb,manager:fb,wordPairs:Cb,footer:gb,date:bb,wordData:yb,textField:vb,segmentedControl:xb,tabs:_b,fileUpload:wb,avatar:Bb,myHomework:kb,trainingStatus:Ab,store:Nb,progress:Eb,trainingMiss:Db,table:Sb,wordScore:jb,topBanner:Tb,datePicker:Mb,report:Lb,tooltip:$b,phonemeProfile:Rb,bulkBar:Pb,debug:Ib,badge:Fb,loader:Ob,soundCompass:zb,breadcrumb:Wb,board:Hb,promoBannerBg:Vb};const Ub="0.363.0",Gb=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],po="ko",Kb="ihab_display_language";function Gl(){if(typeof window>"u")return po;try{const e=localStorage.getItem(Kb);if(e&&Gb.some(t=>t.code===e))return e}catch{}return po}function Kl(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",Kl),Kl(Gl()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:Hg},en:{translation:qb}},lng:Gl(),fallbackLng:po,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Yb=new Map;try{Rt.store?.on?.("added",()=>Yb.clear())}catch{}let or=null,Yl=null,Zl=null;function Zb(){const e=Rl();if(e&&e.entries.length>0){const t=iC();if(or&&Yl===e&&Zl===t)return or;const a=new Set,r=[];for(const l of e.entries)!l.word||a.has(l.word)||(a.add(l.word),r.push({w:l.word,s:l.syllables,p:t?.[l.word]?[...t[l.word].cho??[],...t[l.word].jung??[],...t[l.word].jong??[]]:[],pron:l.pronunciation||l.word,grade:l.grade}));return or=r,Yl=e,Zl=t,or}return[]}new Proxy([],{get(e,t){const a=Zb(),r=a[t];return typeof r=="function"?r.bind(a):r}});function Xb(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function Jb(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&Xb(r.attrValue)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function Qb(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),[s,i]=o.useState(null),[u,c]=o.useState(null),[d,m]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),l(null),i(null),c(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=Zr(e):/^(Logo|Symbol)/i.test(p)?f=Zr(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),i(null),c(null),a(e),l(f)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function f(){try{let b=await fetch(r);b.ok||(b=await fetch(r));const x=b.headers.get("content-type")||"";if(p)return;if(x.includes("svg")){i("mask");return}if(x.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const h=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(h)){const _=Jb(h);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return f(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,f=null;return s==="mask"&&r&&fetch(r).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.blob()}).then(b=>{p||(f=URL.createObjectURL(b),m(f))}).catch(()=>{p||i("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),m(null)}},[s,r]),t===e?{iconToUse:r,mode:s,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function Qe(e){const{icon:t,label:a,className:r,imgClassName:l,maskClassName:s,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",m=l??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=i??"iconRenderer-icon-svg",b=typeof t=="string"?t:null,x=W1(b),{iconToUse:C,mode:h,svgText:_,blobUrl:g}=Qb(b),A=(k,E={})=>n.jsx("span",{className:d,style:u,...E,children:k}),y=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,w=(k,E={})=>n.jsx("img",{src:k,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:m,...E,style:y?{...E.style,...y}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(h==="mask"){const k={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:k}),{"aria-hidden":"true"})}return h==="img"?A(w(C,{onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):h==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return w(Zr(t),{style:u,onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,B=`<svg width="${v}" height="${v}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:B}}),{"aria-hidden":"true"})}function Xl(e){const[t,a]=o.useState(!1),r=o.useRef(!1),l=o.useRef(!0);o.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const s=o.useCallback(()=>{if(!e||r.current)return;const i=e();if(i&&typeof i.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,l.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:s}}function ey({icon:e,title:t,message:a,action:r,className:l}){const{pending:s,press:i}=Xl(r?.onClick);return n.jsxs("div",{className:_e("empty-state",l),children:[e&&n.jsx(Qe,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:i,disabled:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(Qe,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function ty({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:l,className:s}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=Xl(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(Qe,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??i("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(Qe,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:l??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function ny({icon:e,title:t,description:a,cta:r,tone:l="main",disabled:s=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,m=`${c}-desc`,p=`${c}-cta`,f=()=>{s||i?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${m} ${p}`,onClick:f,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f())},className:_e("action-card",`action-card--${l}`,s&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(Qe,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:m,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(Qe,{icon:"arrow-right",size:18})})]})]})})}function ay({as:e="div",className:t="",children:a,storage:r,...l}){r&&Sf({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...l,children:a})}function ry(e){if(e.closest('[aria-hidden="true"], [hidden], [inert]'))return!1;for(let t=e;t;t=t.parentElement){const a=window.getComputedStyle(t);if(a.display==="none"||a.visibility==="hidden"||a.visibility==="collapse")return!1}return!0}function mo(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=l=>{if(l.key!=="Tab")return;const s=Array.from(a.querySelectorAll(gn)).filter(ry);if(!s.length){l.preventDefault();return}const i=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;l.shiftKey&&(c===i||d)?(l.preventDefault(),u.focus()):!l.shiftKey&&c===u&&(l.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const gn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ho=new WeakMap;function fo(e,t){e&&ho.set(e,t)}function Co(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!ho.has(r);)r=r.parentElement;if(!r)return t;t=ho.get(r)??null}return t}function Jl(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function sr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(Jl(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const l=Array.from(document.querySelectorAll(gn)).filter(c=>!(e&&e.contains(c))&&Jl(c));let s=null,i=null;for(const c of l)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:i||(i=c);const u=s??i;return u?.focus(),u}function oy({title:e="",lines:t=[],notices:a=null,children:r,variant:l="default",dismissible:s=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),m=o.useRef(null),p=o.useCallback(()=>{const C=m.current;C&&C.contains(document.activeElement)&&sr(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${l} body-2 ${i}`.trim(),b=s&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:f,role:"note",children:[a.map((C,h)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},h)),b]});const x=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,h)=>n.jsx("li",{className:"notice-box__line",children:C},h))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:m,className:f,role:"note",children:[x,b]})}const ua=[];let lr=!1;function Ql(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ua[ua.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return ua.push(e),!lr&&typeof document<"u"&&(document.addEventListener("keydown",Ql),lr=!0),()=>{const t=ua.lastIndexOf(e);t>=0&&ua.splice(t,1),ua.length===0&&lr&&typeof document<"u"&&(document.removeEventListener("keydown",Ql),lr=!1)}}const ei=o.createContext(null);function sy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const ti=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function ly(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return js.useSyncExternalStore(t,()=>ti(e),()=>!1)}function iy(e){const[t,a]=o.useState(ti(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),l=i=>a(i.matches),s=r;return s.addEventListener?s.addEventListener("change",l):s.addListener&&s.addListener(l),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",l):s.removeListener&&s.removeListener(l)}},[e]),t}const uy=typeof js.useSyncExternalStore=="function"?ly:iy;function un(e){const t=o.useContext(ei),a=uy(e);return t&&typeof t.mobile=="boolean"&&sy(e)?t.mobile:a}const cy="(prefers-reduced-motion: reduce)";function go(){return un(cy)}function hn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:l=20,onClose:s,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:m,backdrop:p=!1,isMobilePopup:f=!1,useBorder:b=!0,header:x,focusOnOpen:C}=e||{},h=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,y]=o.useState(!1),[w,v]=o.useState("bottom"),[B,k]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,I=o.useCallback((U=!1)=>{if(E&&f)return;const $=a?a.getBoundingClientRect():t;if(!$||!h.current)return;const V=h.current,{offsetWidth:z,offsetHeight:Y}=V,S=window.innerWidth,R=window.innerHeight,F=S-$.right,Z=$.left,pe=$.top,re=R-$.bottom;let oe=0,ne=0,W="top";if(pe>=Y+r)W="top",ne=$.top-r-Y,oe=$.left+$.width/2-z/2;else if(re>=Y+r)W="bottom",ne=$.bottom+r,oe=$.left+$.width/2-z/2;else if(F>=z+r)W="right",oe=$.right+r,ne=$.top+$.height/2-Y/2;else if(Z>=z+r)W="left",oe=$.left-r-z,ne=$.top+$.height/2-Y/2;else{const de=Math.max(pe,re,F,Z);de===pe?(W="top",ne=$.top-r-Y,oe=$.left+$.width/2-z/2):de===re?(W="bottom",ne=$.bottom+r,oe=$.left+$.width/2-z/2):de===F?(W="right",oe=$.right+r,ne=$.top+$.height/2-Y/2):(W="left",oe=$.left-r-z,ne=$.top+$.height/2-Y/2)}const ie=Number.isFinite(Number(l))?Number(l):8;oe=Math.min(Math.max(oe,ie),S-z-ie),ne=Math.min(Math.max(ne,ie),R-Y-ie);const q=Math.round(oe),G=Math.round(ne);U&&h.current?(h.current.style.left=`${q}px`,h.current.style.top=`${G}px`,h.current.dataset.placement=W):(v(W||w),g({position:"fixed",left:q,top:G}),k(!0))},[E,f,a,t,r,l,w]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),k(!0);return}I();const U=requestAnimationFrame(()=>I());return()=>cancelAnimationFrame(U)},[t,a,r,m,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f||!h.current||typeof ResizeObserver>"u")return;const U=new ResizeObserver(()=>{t&&I()});return U.observe(h.current),()=>U.disconnect()},[t,m,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f)return;let U=null;const $=()=>{if(typeof requestAnimationFrame>"u"){I(!0);return}U===null&&(U=requestAnimationFrame(()=>{U=null,I(!0)}))},V=z=>{if(!a&&s){const Y=z.target;if(Y&&h.current&&h.current.contains(Y))return;try{if(Y&&Y.closest&&Y.closest("[data-tooltip-ignore]"))return}catch{}L.current(!0);return}$()};return window.addEventListener("resize",$),document.addEventListener("scroll",V,{passive:!0,capture:!0}),()=>{U!==null&&cancelAnimationFrame(U),window.removeEventListener("resize",$),document.removeEventListener("scroll",V,{capture:!0})}},[t,a,s,r,m,l,N,E,f,I]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const U=window.matchMedia("(max-width: 768px)"),$=()=>D(!!U.matches);$();try{U.addEventListener?U.addEventListener("change",$):U.addListener($)}catch{try{U.addListener($)}catch{}}return()=>{try{U.removeEventListener?U.removeEventListener("change",$):U.removeListener($)}catch{}}},[]);const P=o.useRef(!1),K=o.useRef(null),T=go(),M=o.useCallback((U=!1)=>{if(s&&!(A||P.current)){if(P.current=!0,U){y(!0);try{s&&s()}catch{P.current=!1,y(!1)}return}y(!0),K.current=setTimeout(()=>{K.current=null;try{s&&s()}catch{P.current=!1,y(!1)}},T?0:200)}},[A,s,y,T]);o.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]),o.useEffect(()=>{if(N)return;const U=z=>{const Y=h.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},$=z=>{const Y=h.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},V=z=>{if(z.key==="Tab"){const Y=h.current;if(!Y)return;const S=Y.querySelectorAll(gn);if(!S||S.length===0)return;const R=S[0],F=S[S.length-1],Z=document.activeElement;z.shiftKey?Z===R&&(z.preventDefault(),F.focus()):Z===F&&(z.preventDefault(),R.focus())}};return document.addEventListener("pointerdown",U,!0),document.addEventListener("click",$,!0),document.addEventListener("keydown",V),()=>{document.removeEventListener("pointerdown",U,!0),document.removeEventListener("click",$,!0),document.removeEventListener("keydown",V)}},[s,i,M,N]);const L=o.useRef(M);o.useEffect(()=>{L.current=M});const Q=!!s;o.useEffect(()=>{if(!(N||!Q))return Gn(()=>L.current())},[N,Q]),o.useEffect(()=>{const U=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",U),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",U)}},[M]);const H=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!B)return;const U=h.current;if(!U)return;const $=U.querySelector(gn);if($)return H.current=document.activeElement,$.focus(),()=>{const V=H.current;H.current=null,V&&document.contains(V)&&V.focus()}},[N,C,B]),o.useEffect(()=>{c==="dialog"&&!d&&St("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const O=n.jsxs("div",{ref:h,className:`tooltip-content ${N?"tooltip-content--inline":""} ${b?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:B?"visible":"hidden"},tabIndex:-1,"data-placement":w,"data-left":N?"":_.left,"data-top":N?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),m]});if(N||typeof document>"u")return O;if(p||E&&f){const U=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&M(!0)}}),O]});return nn.createPortal(U,document.body)}return nn.createPortal(O,document.body)}function wn(e){const{anchorRect:t,text:a,offset:r=8,onClose:l,className:s="",ariaLabel:i}=e||{};return a?n.jsx(hn,{anchorRect:t,offset:r,onClose:l,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:i||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:l,activeIndex:s=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},m=(Array.isArray(l)?l:l?[l]:[]).map(p=>typeof p=="string"?{text:p}:p);return!m.length&&!r?null:n.jsx(hn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:m.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[i&&m.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function $a(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let bo=0,ni=!1;function ai(){ni||typeof document>"u"||(ni=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(bo=Date.now())},!0),document.addEventListener("touchstart",()=>{bo=Date.now()},{capture:!0,passive:!0}))}ai();function ca(e){return!!e&&e.pointerType==="touch"}function da(e=1e3){return ai(),Date.now()-bo<e}function yo(e,t,a,{enabled:r=!0,fallbackOnParent:l=!1}={}){const s=$a(e),i=$a(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const m=p=>{const f=p,b=p.target,x=a.current,C=!!(b&&x&&x.contains(b));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(b&&b.closest?.(".tooltip-content"))&&i.current(!1,x)};return document.addEventListener("pointerdown",m,!0),()=>document.removeEventListener("pointerdown",m,!0)},[r,a,s,i]);const d=o.useCallback(m=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),i.current(!p,m??a.current),!0)},[a,i]);return o.useEffect(()=>{if(!r||!l)return;const m=a.current,p=m?.parentElement;if(!m||!p)return;let f=null;const b=h=>{const _=h.changedTouches?.[0];if(!_)return!1;const g=m.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=h=>{f=b(h)?s.current:null},C=h=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!b(h))&&(u.current=null,c.current=Date.now(),i.current(!_,m))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,l,a,s,i]),{touchPress:d}}function dy(e,t){const{size:a=48,type:r,htmlType:l,href:s,target:i,rel:u,icon:c,rightIcon:d,label:m,count:p,subLabel:f,children:b,ariaLabel:x,variant:C="default",align:h="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:y,ariaControls:w,disabled:v=!1,useLabel:B=!0,useBorder:k=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,useDisabledFilled:I=!1,width:P,minWidth:K,onClick:T,onDisabledClick:M,showTooltipInfo:L=!1,tooltipInfoText:Q=null,tooltipDescription:H=null,tooltipOnly:O=!1,iconSize:U="medium",iconColor:$,shape:V="rounded",color:z,className:Y,...S}=e,R=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),F=R.match(/^\d+$/)?`button${R}`:`button-${R}`,Z=Number(a),pe=!isNaN(Z)&&Z<40?"button-2":"button-1",re=m??b,oe=v||!!S.disabled,ne=oe?D?"disabled-covered":N?"disabled-invisibled":I?"disabled-filled":"disabled":C,W=ne?`button--variant-${ne}`:"",ie=h?`button--align-${h}`:"",q=_?"button--nowrap":"",G=V?`button--shape-${V}`:"",de=typeof $=="string"&&$.startsWith("--")?`var(${$})`:$,Ee={...P?{width:typeof P=="number"?`${P}px`:P}:{},...K?{minWidth:typeof K=="number"?`${K}px`:K}:{},...k?{}:{"--button-border":oe?"0":"1px solid transparent"},...de?{"--button-icon-color":de}:{},...z?{"--color-main":z}:{}},ye=B===!1?"":re,me=Array.isArray(ye)?ye.length>0:!!ye,se=!!d,Ce=r??(me||c||se?"bar":"dot"),ge=`${F}--${Ce}`,ce=o.useRef(null);o.useEffect(()=>{!$n||l!==void 0||ce.current?.closest("form")&&St(`button-in-form:${typeof re=="string"?re:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof re=="string"&&re?` \uB2E8\uCD94: ${re}`:""))},[l,re]);const Me=o.useRef(t);Me.current=t;const Oe=o.useCallback(Pe=>{ce.current=Pe;const nt=Me.current;typeof nt=="function"?nt(Pe):nt&&(nt.current=Pe)},[]),Le=o.useRef(oe),[ze,We]=o.useState(!!g),[dt,lt]=o.useState(!1),[at,mt]=o.useState(null),Ae=o.useCallback(()=>lt(!1),[]),[qe,we]=o.useState(!1),Ue=o.useId();o.useEffect(()=>{typeof g=="boolean"&&We(g)},[g]),o.useEffect(()=>{if(Le.current&&!oe&&ce.current){const Pe=ce.current;let nt=!1;try{nt=Pe.matches(":focus:not(:focus-visible)")}catch{nt=!1}nt&&Pe.blur(),Pe.style.pointerEvents="none";const vt=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce.current&&(ce.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(vt)}Le.current=oe},[oe]);const ke=typeof g=="boolean"?!!g:ze,$e=typeof y=="boolean"?void 0:A||typeof g=="boolean"?ke?"true":"false":S["aria-pressed"],je=_e("button",F,ge,W,ie,q,G,ke?"is-selected":null,E?null:"button--no-bg",O?"button--tooltip-only":null,Y),Ze=`button__icon button__icon--${U}`,yt=Array.isArray(f)?f:f!==void 0?[f]:[],et=()=>{if(Array.isArray(ye))return ye.map((nt,vt)=>{const Ge=yt[vt];return n.jsxs("span",{className:`button__label-text${Ge!==void 0?" button__label-text--has-sub":""}`,children:[nt,Ge!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Ge})]},vt)});const Pe=f!==void 0;return n.jsxs("span",{className:`button__label-text${Pe?" button__label-text--has-sub":""}`,children:[ye,p!=null&&n.jsx("span",{className:"button__count",children:p}),Pe&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},Xe=Pe=>{typeof g!="boolean"&&!A&&We(!1),Pe.currentTarget.blur()},_t=Pe=>{oe||(typeof S.onMouseLeave=="function"&&S.onMouseLeave(Pe),Xe(Pe))},Ct=Pe=>{if(O&&ht&&rt.touchPress(Pe.currentTarget),oe){ht&&rt.touchPress(Pe.currentTarget),Pe.preventDefault(),M?.(Pe);return}typeof g!="boolean"&&A&&We(nt=>!nt),T?.(Pe)},wt=o.useCallback(()=>{(L||H)&&(lt(!0),mt(ce.current?.getBoundingClientRect()??null))},[L,H]),Bt=o.useCallback(()=>{(L||H)&&(lt(!1),mt(null))},[L,H]),ht=!!(L||H),rt=yo(dt,Pe=>{Pe?wt():Bt()},ce,{enabled:ht&&(oe||O),fallbackOnParent:ht&&oe}),te={...S};delete te.disabled,delete te.className,delete te.faded,delete te.useFaded,delete te.loading,delete te.onMouseLeave,delete te.onPointerEnter,delete te.onPointerLeave,delete te.onPointerUp,delete te.onFocus,delete te.onBlur,oe&&(Object.keys(te).forEach(Pe=>{/^on[A-Z]/.test(Pe)&&typeof te[Pe]=="function"&&delete te[Pe]}),te["aria-disabled"]="true");const Ne=(typeof L=="string"?L:null)??(typeof Q=="string"?Q:null)??(typeof x=="string"?x:null)??(typeof re=="string"?re:null)??void 0,Je=typeof x=="string"?x:typeof re=="string"?re:Ne,Ve=H?[H.title,...H.items??[]].filter(Boolean).join(". "):L&&Ne&&Ne!==Je?Ne:"",it=[typeof S["aria-describedby"]=="string"?S["aria-describedby"]:void 0,Ve?Ue:null].filter(Boolean).join(" ")||void 0,Se=(Pe,nt)=>n.jsx(Qe,{icon:Pe,label:nt??Je,className:Ze,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),pt=()=>Ce==="dot"?n.jsxs(n.Fragment,{children:[Se(c),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}):h==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Se(c)}),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:Se(c,x??re)}),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}),gt=!!s&&!oe;return n.jsxs(n.Fragment,{children:[n.jsxs(gt?"a":"button",{...te,ref:Oe,...gt?{href:s,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:l??"button",disabled:oe&&!M&&!qe},className:je,"aria-pressed":$e,"aria-expanded":typeof y=="boolean"?y:S["aria-expanded"],"aria-controls":w??S["aria-controls"],"aria-label":Je,"aria-disabled":oe&&(gt||M||qe)?!0:void 0,"aria-describedby":it,style:Ee,onClick:Ct,onMouseLeave:_t,onPointerEnter:Pe=>{ca(Pe)||wt(),!oe&&typeof S.onPointerEnter=="function"&&S.onPointerEnter(Pe)},onPointerLeave:Pe=>{ca(Pe)||Bt(),!oe&&typeof S.onPointerLeave=="function"&&S.onPointerLeave(Pe)},onPointerUp:Pe=>{oe&&ht&&rt.touchPress(Pe.currentTarget),!oe&&typeof S.onPointerUp=="function"&&S.onPointerUp(Pe)},onFocus:Pe=>{we(!0),da()||wt(),!oe&&typeof S.onFocus=="function"&&S.onFocus(Pe)},onBlur:Pe=>{we(!1),oe||Xe(Pe),Bt(),!oe&&typeof S.onBlur=="function"&&S.onBlur(Pe)},children:[pt(),Ve?n.jsx("span",{id:Ue,hidden:!0,"aria-label":Ve}):null]}),dt&&H?n.jsx(Kn,{anchorRect:at,title:H.title,items:H.items,onClose:Ae}):dt&&Ne?n.jsx(wn,{anchorRect:at,text:Ne,onClose:Ae}):null]})}const fe=o.forwardRef(dy);fe.displayName="Button";function Nt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const l=r.current?.parentElement??null;return t(l,e),()=>a(l)},[e,t,a]),r}const Ra={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},vo=new WeakMap;function xo(e){if(e)return vo.get(e)}function Wt(e,t){e&&(e.style.setProperty(Ra.title,t.title),e.style.setProperty(Ra.description,t.description),vo.set(e,t))}function Ht(e){e&&(e.style.removeProperty(Ra.title),e.style.removeProperty(Ra.description),vo.delete(e))}const ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function oi(){const e=Nt(ri,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const si={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function li(){const e=Nt(si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const ii={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ui(){const e=Nt(ii,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function di(){const e=Nt(ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const pi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function mi(){const e=Nt(pi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const hi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function fi(){const e=Nt(hi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const Ci={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function gi(){const e=Nt(Ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const bi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function yi(){const e=Nt(bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const vi={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function xi(){const e=Nt(vi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const _i={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function wi(){const e=Nt(_i,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Bi={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ki(){const e=Nt(Bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const Ai={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ni(){const e=Nt(Ai,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Ei={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function Di(){const e=Nt(Ei,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Si={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function ji(){const e=Nt(Si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),py=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Ti={main:oi,soft:li,sub:ui,deep:di,softSub:mi,warm:fi,dark:gi,radial:yi,diagonal:xi,dots:wi,outline:ki,success:Ni,naver:Di,instagram:ji};function Mi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:l=.1,lineHeightRatio:s=1.4}={}){const i=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const y=localStorage.getItem(A),w=y?Number(y):1;return Number.isFinite(w)?i(w):i(1)}catch{return i(1)}},[c,d]=o.useState(()=>u(e)),[m,p]=o.useState(e);m!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const f=A=>{d(typeof A=="function"?y=>i(A(y)):i(A))},b=()=>f(A=>+(A+l).toFixed(6)),x=()=>f(A=>+(A-l).toFixed(6)),C=c<r-Number.EPSILON,h=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:b,decrease:x,canIncrease:C,canDecrease:h,fontSize:_,lineHeight:g}}function Li(e,t){const a=$a(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const _o=" \xB7 ",$i=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(_o)?e.split(_o).pop()??e:e})(),my=o.createContext(!1),Yn=[];let Ri=null;function hy(e){const t=o.useContext(my);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Ri=document.title);const a={text:$i?`${e}${_o}${$i}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Ri??document.title}},[e,t])}const wo=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],fy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function on(e,t){return fy().compare(e,t)}const ir=new Map;function Cy(e){const t=ir.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let l=0;for(let s=r.exec(e);s;s=r.exec(e)){let i=s.index,u=s[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>l&&a.push(e.slice(l,i)),a.push(Number(u)),l=s.index+s[0].length}return l<e.length&&a.push(e.slice(l)),ir.size>5e3&&ir.clear(),ir.set(e,a),a}function gy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function by(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),l=a(t);if(r===l)return 0;const s=(d,m)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=gy(m);return p!==null?[p]:Cy(m)},i=s(e,r),u=s(t,l),c=Math.min(i.length,u.length);for(let d=0;d<c;d++){const m=i[d],p=u[d];if(typeof m=="number"&&typeof p=="number"){if(m!==p)return m-p;continue}if(typeof m=="number")return-1;if(typeof p=="number")return 1;const f=on(m,p);if(f!==0)return f}return i.length!==u.length?i.length-u.length:on(r,l)}const Pi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function Bo(e,t,a){const r=Pi(e),l=Pi(t);if(r||l)return r===l?0:r?1:-1;const s=by(e,t);return a?s:-s}function yy(e,t,a){const{t:r}=xe.useTranslation(),[l,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&wo.some(C=>C.value===x)?x:"25"}),[i,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),i!==1&&u(1));const m=o.useMemo(()=>wo.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{wo.some(C=>C.value===x)&&(s(x),u(1))},[]),f=Math.max(1,Math.ceil(e.length/Number(l))),b=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),f);return i!==b&&u(b),{pageRows:o.useMemo(()=>e.slice((b-1)*Number(l),b*Number(l)),[e,b,l]),pageSizeProps:{options:m,value:l,onChange:p},paginationProps:{page:b,total:f,onChange:u},setPage:u}}function vy(e){const[t,a]=o.useState(null),r=o.useRef(t),l=o.useRef(e?.onSortChange);l.current=e?.onSortChange;const s=o.useCallback(c=>{const d=r.current,m=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=m,a(m),l.current?.(m)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:m,asc:p}=t;return[...c].sort((f,b)=>Bo(d(f,m),d(b,m),p))},[t]);return{sort:t,field:i,sortRows:u}}const fn="\uC804\uCCB4";Object.fromEntries(Object.entries(Qf).map(([e,{nucleus:t}])=>[e,t]));const xy={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},_y={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},wy={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function By(e,t){if("place"in t)return xy[t.place](e);const a=_y[t.vowel](e);return t.glide?`${a} \xB7 ${wy[t.glide](e)}`:a}const ky=(e,{defaultValue:t})=>t,Ii=(e,t)=>({jamos:e,phonetic:t,tooltip:By(ky,t)}),Bn=(e,t)=>t.map(a=>Ii([a],{place:e})),Pt=(e,t,a)=>Ii([...e],a?{vowel:t,glide:a}:{vowel:t}),ko={cho:[Bn("labial",["\u3142","\u3143","\u314D","\u3141"]),Bn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Bn("alveolar",["\u3145","\u3146"]),Bn("palatal",["\u3148","\u3149","\u314A"]),Bn("velar",["\u3131","\u3132","\u314B"]),Bn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[Bn("labial",["\u3142","\u3141"]),Bn("alveolar",["\u3137","\u3134","\u3139"]),Bn("velar",["\u3131","\u3147"])]},Ay=e=>e===Ny?[]:Array.from(e),Ny="__NO_CODA__",Ao=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:l})=>({v:a.join(""),phonetic:r,tooltip:l}))),Fi={cho:Ao(ko.cho),jung:Ao(ko.jung),jong:Ao(ko.jong)};Fi.jung.flat().forEach(({v:e})=>{for(const t of Ay(e));}),new Set(Fi.cho.flat().map(e=>e.v));function Ey(e,t=!0){const a=$a(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Pa(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),l=o.useCallback(s=>{const i=s.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:l}}function Dy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const i=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),l(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),l(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Oi(e="warning"){const[t,a]=o.useState(""),[r,l]=o.useState(e),[s,i]=o.useState(0),u=o.useCallback((p,f)=>{l(f),a(p),i(b=>b+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),m=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:s,showToast:u,showWarning:c,showNormal:d,clearToast:m}}function Ia(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Fa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[l,s]=o.useState(!1),[i,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),m=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{l&&m()},[l,m]),o.useEffect(()=>{if(!l)return;let b=d.current?.offsetHeight??0;b>0&&m();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const B=d.current?.offsetHeight??0;if(B!==b){if(b=B,++x>4){C?.disconnect(),C=null;return}m()}}),C.observe(d.current));const h=B=>{const k=B.target;r&&k.closest?.(r)||c.current?.contains(k)||d.current?.contains(k)||s(!1)};document.addEventListener("mousedown",h),document.addEventListener("pointerdown",h);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){m();return}_===null&&(_=requestAnimationFrame(()=>{_=null,m()}))},A=B=>{d.current?.contains(B.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const y=()=>{a==="reposition"?g():a==="close"&&s(!1)};let w=null;const v=()=>{y(),w&&clearTimeout(w),w=setTimeout(()=>{w=null,a==="reposition"&&m()},250)};return a!=="ignore"&&(window.addEventListener("resize",y),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",h),document.removeEventListener("pointerdown",h),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",y),window.removeEventListener("orientationchange",v)),w&&clearTimeout(w)}},[l,m,t,a,r]),o.useEffect(()=>{if(l)return Gn(()=>s(!1))},[l]);const p=o.useCallback(()=>s(b=>!b),[]),f=o.useCallback(()=>s(!1),[]);return{open:l,setOpen:s,toggle:p,close:f,style:i,triggerRef:c,menuRef:d}}function Sy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:l,playMs:s=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,m]=o.useState(0),[p,f]=o.useState("idle"),[b,x]=o.useState(null),[C,h]=o.useState([]),[_,g]=o.useState(null),[A,y]=o.useState(0),w=o.useRef(0),v=o.useCallback($=>{w.current=typeof $=="function"?$(w.current):$,y(w.current)},[]),B=o.useRef(r),k=o.useRef(l);o.useEffect(()=>{B.current=r,k.current=l},[r,l]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=($,V)=>{E.current.push(setTimeout(V,$))};o.useEffect(()=>()=>D(),[]);const I=u[d]?.id??null,P=o.useRef(null),K=o.useCallback(()=>{D(),f("playing"),h([]),g(null),v(0);let $=0;e.forEach((V,z)=>{N($,()=>{m(z),x(V.id),B.current?.(V)}),N($+1e3,()=>{x(null),h(Y=>[...Y,V.id])}),$+=1300}),N($,()=>{f("done"),k.current?.({score:0,total:e.length})})},[e,v]),T=o.useCallback(($,V)=>{if(V>=$.length){f("done"),k.current?.({score:w.current,total:$.length});return}P.current=null,m(V),g(null),f("playing"),x($[V].id),B.current?.($[V]),N(s,()=>{x(null),f("waiting")})},[s]),M=o.useCallback(()=>{D();const $=Ta(e);c($),v(0),h([]),T($,0)},[e,T,v]),L=o.useCallback(()=>{t==="playback"?(c(e),K()):M()},[t,e,K,M]),Q=o.useCallback(()=>{D(),f("idle"),x(null),h([]),g(null),m(0),v(0),c([])},[v]),H=JSON.stringify(e.map($=>[$.id,$.label,$.angleDeg,$.deg,$.row,$.shortcut]));o.useEffect(()=>(a?L():Q(),()=>D()),[t,H,a]);const O=o.useCallback($=>{p!=="waiting"||t==="playback"||P.current===d||(P.current=d,g($),$===u[d]?.id&&v(V=>V+1),t==="exam"?(f("playing"),N(400,()=>T(u,d+1))):(f("feedback"),N(i,()=>T(u,d+1))))},[p,t,u,d,T,i,v]),U=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:b,playedIds:C,selectedId:_,answerId:I,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:O},index:d,total:U,score:A,phase:p,done:p==="done",start:L,reset:Q}}const No=new Map,Eo=new Map,jy=()=>()=>{},Ty=()=>!0,My=()=>!1;function zi(e){const t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e);if(!t)return null;try{if(!t[1])return decodeURIComponent(t[2]);const a=Uint8Array.from(atob(t[2]),r=>r.charCodeAt(0));return new TextDecoder("utf-8").decode(a)}catch{return null}}function Ly(e){if(typeof window>"u")return"";const t=(a,r)=>{const l=r.attrName.toLowerCase(),s=r.attrValue.trim();(l==="href"||l==="xlink:href")&&!s.startsWith("#")&&(r.keepAttr=!1),(l==="style"||s.includes("\\")&&s.includes("("))&&(r.keepAttr=!1);const i=s.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function $y(e,t){const a=new Set;for(const i of e.matchAll(/url\(\s*(['"]?)#([^)\s"']+)\1\s*\)/g))a.add(i[2]);for(const i of e.matchAll(/(?:xlink:)?href="#([^"]+)"/g))a.add(i[1]);const r=new Set([...e.matchAll(/id="([^"]*)"/g)].map(i=>i[1])),l=[...a].filter(i=>r.has(i));if(l.length===0)return e;let s=e;for(const i of l){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;s=s.replace(new RegExp(`id="${u}"`,"g"),`id="${c}"`).replace(new RegExp(`url\\(\\s*(['"]?)#${u}\\1\\s*\\)`,"g"),(d,m)=>`url(${m}#${c}${m})`).replace(new RegExp(`((?:xlink:)?href)="#${u}"`,"g"),`$1="#${c}"`)}return s}function Ry(e){const t=Eo.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&No.set(e,r),r)).catch(()=>null).finally(()=>{Eo.delete(e)});return Eo.set(e,a),a}function Py(e,t=!0){const a=o.useSyncExternalStore(jy,Ty,My)&&t&&e?zi(e)??No.get(e)??null:null,[r,l]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){l({src:e,enabled:t,svg:null});return}const s=zi(e)??No.get(e)??null;if(s!==null){l({src:e,enabled:t,svg:s});return}let i=!0;return Ry(e).then(u=>{i&&l({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Iy({title:e,description:t,actionLabel:a,onAction:r,bg:l,color:s,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:m=""}){const p=l??s??"main",f=o.useRef(null),[b,x]=o.useState("main"),C=un("(max-width: 767px)"),h=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=xo(A),w=(v,B,k)=>{if(k!==void 0)A.style.setProperty(B,k),h.current[v]=!0;else if(h.current[v]){const E=y?.[v];E?A.style.setProperty(B,E):A.style.removeProperty(B),h.current[v]=!1}};w("title","--promo-banner-bg-title",c),w("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=xo(A);x(y?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${i}`,m),g=Ti[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${i==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(fe,{htmlType:"button",size:40,variant:u??b,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Fy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":l}){const{t:s}=xe.useTranslation(),i=l??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,m]=o.useState(0),[p,f]=o.useState(!1),[b,x]=o.useState(!1),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),y=go(),w=p||b||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||w||y)return;const k=window.setInterval(()=>m(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(k)},[c,t,w,y]);const B=k=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,h(!1)},k)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const k=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!1)))};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:k=>{_.current=k.pointerType},onPointerDown:k=>{_.current=k.pointerType,k.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!0))},onPointerUp:k=>{k.pointerType==="touch"&&B(5e3)},onPointerCancel:k=>{k.pointerType==="touch"&&B(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:k=>{let E=!0;try{E=k.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((k,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:k},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((k,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>m(E)},E))})]})}function Oy({title:e,body:t,open:a=!1,onToggle:r,avatar:l,titleClassName:s="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const m=d.currentTarget.closest('[role="list"]');if(!m)return;const p=Array.from(m.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[l&&n.jsx("div",{className:"accordion-item__avatar",children:l}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(Qe,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${i}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function zy({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:l}){const[s,i]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(Oy,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>i(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:l},c.id??d))})}function Wy(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function Hy(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function Vy(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function Et(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:l="","aria-label":s,"aria-hidden":i}=e;if(a==="dot"){const{icon:w,number:v,position:B="top-right",onClick:k,animate:E=!1}=e,D=w??"check",N=v!==void 0?"number":D,I=typeof r=="number"?r:32,P=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${B}`,`circle-badge--${I}`,E?"circle-badge--animate":"",k?"circle-badge--clickable":"",l),K=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:P,onClick:k,onKeyDown:k?T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.currentTarget.click())}:void 0,"aria-label":i?void 0:s??K,"aria-hidden":i||void 0,role:k?"button":i?void 0:"img",tabIndex:k?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(Wy,{}),v===void 0&&D==="remove"&&n.jsx(Hy,{}),v===void 0&&D==="minus"&&n.jsx(Vy,{})]})}const{label:u,children:c,variant:d="default",fill:m="filled",minWidth:p,iconLeft:f,iconRight:b,color:x}=e,C=typeof r=="number"?"medium":r??"medium",h={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,m!=="filled"?`badge--${m}`:"",h,l),A=x?.startsWith("--")?`var(${x})`:x,y=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:y,"aria-label":i?void 0:s,role:s&&!i?"img":void 0,"aria-hidden":i||void 0,children:[f&&n.jsx(Qe,{icon:f,size:_,className:"badge__icon"}),u??c,b&&n.jsx(Qe,{icon:b,size:_,className:"badge__icon"})]})}function Oa({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:l}=xe.useTranslation(),s=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const h=[{title:null,columns:e}];let _=e;for(const g of i){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],h.push({title:A.label||null,columns:_})}return h},[e,i]),d=c[c.length-1],m=c.length-1,p=o.useCallback(()=>u(h=>h.slice(0,Math.max(0,Math.min(h.length,m)-1))),[m]),f=o.useRef(null),b=o.useRef(null),x=c.length;o.useEffect(()=>{b.current||(b.current=document.activeElement);let h=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>cancelAnimationFrame(h)},[x]),o.useEffect(()=>()=>{b.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((h,_,g)=>{if(h){if(Array.isArray(h.children)&&h.children.length){u(A=>[...A.slice(0,m),{ci:_,ii:g}]);return}try{typeof h.onClick=="function"&&h.onClick()}catch{}try{h&&h.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,m]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(fe,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:l("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((h,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[h.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:h.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(h.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(fe,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(Et,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?l("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Wi=".content-area";function Do(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Wi);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Wi}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const So=52,ur=10,Hi=e=>e&&e>0?e:0;function Vi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:l,moreItems:s=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",m=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,b]=o.useState(0),x=e.length;o.useEffect(()=>{const $=p.current;if(!$)return;const V=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle($):null,R=$.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=$.querySelector(".bottom-nav__left"),Z=F?.nextElementSibling,pe=(F?.offsetWidth??0)+(F&&Z?.classList.contains("bottom-nav__divider")?Z.offsetWidth:0);b(Math.max(0,R-pe))};if(V(),typeof ResizeObserver>"u")return;const z=new ResizeObserver(V);z.observe($);const Y=$.querySelector(".bottom-nav__left");return Y&&z.observe(Y),()=>z.disconnect()},[l]);const C=So+1,h=$=>Math.max(0,Math.floor(($+ur)/(So+ur))),_=x*(So+ur)-ur<=f,g=f<=0||s.length===0&&_?x:Math.min(x,h(f-C)),A=f>0&&g<x,y=A?g:x,w=e.slice(0,y),v=e.slice(y),B=A||s.length>0,k=o.useCallback(($,V)=>({position:"fixed",bottom:window.innerHeight-$.top+8,right:window.innerWidth-$.right,zIndex:Ia(V)}),[]),E=o.useId(),{open:D,toggle:N,close:I,style:P,triggerRef:K,menuRef:T}=Fa({computeStyle:k,onScroll:"ignore",onResize:"reposition"}),M=o.useCallback(($,V)=>V>0?u("nav.badgeLabel",{label:$,count:V,defaultValue:"{{label}}, {{count}}\uAC1C"}):$,[u]),L=o.useCallback(($,V)=>V>0?u("nav.badgeInsideLabel",{label:$,count:V,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):$,[u]),Q=o.useCallback(()=>l?.(c),[l,c]),H=o.useMemo(()=>v.find($=>!!$.key&&$.key===t)??s.find($=>$.selected||$.key&&$.key===t),[v,t,s]),O=o.useMemo(()=>[{items:[...v.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:!!$.key&&$.key===t,closeOnSelect:!0,disabled:$.state==="disabled",onClick:()=>{$.state!=="disabled"&&($.key&&a&&(a($.key),Do(i,"BottomNav")),I())}})),...s.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===t),closeOnSelect:!0,onClick:()=>{$.onClick?.(),I()}}))]}],[v,s,t,a,I]),U=[...v,...s].reduce(($,V)=>$+Hi(V.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[l&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:m,className:"bottom-nav-item",onClick:Q})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:w.map(($,V)=>{const z=Hi($.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:$.icon,ariaLabel:M($.label,z),selected:!!$.key&&$.key===t,disabled:$.state==="disabled",className:"bottom-nav-item",onClick:()=>{$.key&&(a?.($.key),Do(i,"BottomNav"))}}),z>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(z,99),size:24})})]},$.key??`__slot-${V}`)})}),B&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:K,className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:H?.icon??"ellipsis",ariaLabel:L(H?.label??u("nav.more","\uB354\uBCF4\uAE30"),U),selected:!!H,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),U>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(U,99),size:24})}),D&&nn.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:P,ref:T,children:n.jsx(Oa,{columns:O,onClose:I})}),document.body)]})})]})]})}function qi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const l=r.charCodeAt(0);l<=32||l>=127&&l<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ui(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function qy(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:l,onNotification:s,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},m="default";return l||s||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[l&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:l,selected:a==="debug"}),s&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bell",ariaLabel:Ui(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(Et,{type:"dot",number:Math.min(r,99),size:24,"aria-hidden":!0})]}),i&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:i,selected:a==="settings"}),u&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function Gi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:l,icon:s,active:i,onClick:u,style:c,state:d,labelStyle:m}=e||{},p=a?.key??r??"",f=a?.label??l??"",b=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(Qe,{icon:b,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),h=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${h?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(h)return;const y=A.detail>0;if(y)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,y)},[h,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ui(t,f,x):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":h,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:m,children:f}),x>0&&n.jsx(Et,{type:"dot",position:"inline",number:Math.min(x,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function Ki(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}=e||{},C=f==="manager",h=o.useCallback(()=>b?.(C?"malgwi":"manager"),[b,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const k=_.current;if(!k)return;let E=null;const D=()=>{const{scrollHeight:P,clientHeight:K,scrollTop:T}=k;if(P<=K+1){A(O=>O===null?O:null);return}const M=Math.max(24,K/P*K),L=K-M,Q=P-K,H={top:Math.round(T/Q*L),height:Math.round(M)};A(O=>O&&O.top===H.top&&O.height===H.height?O:H)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),k.addEventListener("scroll",N,{passive:!0});const I=typeof ResizeObserver<"u"?new ResizeObserver(N):null;I?.observe(k);for(const P of Array.from(k.children))I?.observe(P);return()=>{E!==null&&cancelAnimationFrame(E),k.removeEventListener("scroll",N),I?.disconnect()}},[a]);const y=o.useRef(null),w=o.useCallback(k=>{const E=_.current;E&&(k.preventDefault(),y.current={y:k.clientY,top:E.scrollTop},k.currentTarget.setPointerCapture(k.pointerId))},[]),v=o.useCallback(k=>{const E=_.current,D=y.current;!E||!D||(E.scrollTop=D.top+(k.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),B=o.useCallback(k=>{y.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:w,onPointerMove:v,onPointerUp:B,onPointerCancel:B})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(k=>!k.section&&(k.key||k.label)).map((k,E)=>n.jsxs(o.Fragment,{children:[k.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Gi,{item:k,active:!!k.key&&k.key===r,state:k.disabled?"disabled":void 0,onClick:(D,N,I)=>{if(k.disabled)return;if(k.href){if(qi(k.href)&&window.open(k.href,"_blank","noopener,noreferrer"),I)try{N?.blur()}catch{}return}if(l?.(k.key),Do(x,"SideNav"),!I)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const P=document.querySelector(".header");if(P){const K=typeof P.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&K&&P.matches(":hover"))){P.classList.add("header--force-collapsed");const T=()=>{P.classList.remove("header--force-collapsed"),P.removeEventListener("mouseenter",T)};P.addEventListener("mouseenter",T)}}}})]},k.key??`side-nav__item-${E}`)),b&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),b&&n.jsx(Gi,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:h})]}),n.jsx(qy,{activeKey:r,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p})]})}var cr='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',jo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Uy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';function Yi({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?jo:cr,l=Uy;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:l,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function Zi({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}){const{t:C}=xe.useTranslation(),h=un("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(P=>!P.section&&(P.key||P.label)).map(P=>({key:P.key,label:typeof P.label=="string"?P.label:void 0,icon:P.icon,state:P.disabled?"disabled":void 0,badgeCount:P.badge})),[a]),g=o.useCallback(P=>{const K=a?.find(T=>T.key===P);if(!K?.disabled){if(K?.href){qi(K.href)&&window.open(K.href,"_blank","noopener,noreferrer");return}t?.(P)}},[a,t]),A=o.useMemo(()=>{const P=[];return i&&P.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&P.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&P.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),m&&P.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:m}),p&&P.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&P.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),P},[C,i,u,d,m,p,c,s]),y=o.useCallback((P,K)=>({position:"fixed",top:P.bottom+8,right:Math.max(8,window.innerWidth-P.right),zIndex:Ia(K)}),[]),w=o.useId(),{open:v,toggle:B,close:k,style:E,triggerRef:D,menuRef:N}=Fa({computeStyle:y,onScroll:"ignore",onResize:"reposition"}),I=o.useMemo(()=>[{items:A.map(P=>({label:P.label,icon:P.icon,badgeCount:P.badgeCount,selected:P.selected??(!!P.key&&P.key===e),closeOnSelect:!0,onClick:()=>{P.onClick?.(),k()}}))}],[A,e,k]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Yi,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(fe,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:B,"aria-expanded":v,"aria-controls":v?w:void 0}),!!u&&!!s&&s>0&&n.jsx(Et,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&nn.createPortal(n.jsx("div",{id:w,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(Oa,{columns:I,onClose:k})}),document.body)]})]}),n.jsx(Ki,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b}),h&&n.jsx(Vi,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:b})]})}const Gy=Zi,Ky=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function Xi(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return ia(`${t.toLocaleString("ko-KR")}\uC6D0`)}return ia(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function Yy(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function Zy(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const l=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return l?l[2].toLowerCase()==="year"?`${l[1]}\uB144`:`${l[1]}\uC77C`:a||Ky()}function Xy(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function Ji(e){return{type:e.type??Yy(e),plan:Zy(e),label:e.label,price:Xi(e.price),originalPrice:Xi(e.originalPrice),discountLabel:e.discountLabel}}var Jy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Qy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Qi='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},To=new WeakMap;function e2(e){if(e)return To.get(e)}function kn(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),To.set(e,t))}function An(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),To.delete(e))}const eu={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function tu(e={}){const t=Nt(eu,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${Qi}")`}})]})}const nu="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",pa=240;var za='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/></svg>';const t2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},n2=100,a2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function au(e={}){const t=Nt(t2,kn,An),a="var(--color-main)",r=270,l=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:a2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*n2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const r2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},o2=100,s2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function l2(e={}){const t=Nt(r2,kn,An),a="#ffffff",r=270,l=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:s2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*o2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${Qi}")`}})]})}const i2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function u2(e={}){const t=Nt(i2,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const c2={Logo_SpeechEar_ko:{"":cr,_mono:Jy},Logo_SpeechEarManager_ko:{"":jo,_mono:Qy}};function d2(e,t){if(e)return c2[e]?.[t??""]??void 0}const p2={speechear:cr,manager:jo},m2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},ru=10;function h2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function ou(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const l=Math.floor(e/60);return l>0?t("passCard.remainingMinute",{n:l}):t("passCard.remainingSecond",{n:Math.floor(e)})}function f2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),l=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(u2,{}):l?n.jsx(l2,{}):n.jsx(au,{})}return n.jsx(tu,{})}function su({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:l,endDate:s,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:m=!1,textColor:p,subColor:f,copyrightColor:b,logoSrc:x,label:C,price:h,originalPrice:_,discountLabel:g,onUse:A,onRefund:y,onDelete:w}){const{t:v}=xe.useTranslation(),B=t?Ji(t):void 0,k=l??B?.type??"speechear",E=r??B?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??B?.label,N=h??(a?B?.price:void 0),I=_??(a?B?.originalPrice:void 0),P=g??B?.discountLabel,K=o.useMemo(()=>{if(N)return null;const q=t?.durationDays??Xy(t?.code);if(!q||q<=0)return i!=null?{percent:null,remainingLabel:ou(i,v)}:null;const G=q*86400;let de;if(i!=null)de=i;else if((c==="active"||c==="expired")&&s){const me=new Date(s).getTime();if(Number.isNaN(me))return null;const se=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),Ce=/^(\d{4})-(\d{2})-(\d{2})/.exec(La()),ge=Math.round(se&&Ce?(Date.UTC(+se[1],+se[2]-1,+se[3])-Date.UTC(+Ce[1],+Ce[2]-1,+Ce[3]))/864e5:(me-Date.now())/864e5);de=Math.max(0,u?ge+1:ge)*86400}else c==="expired"?de=0:de=G;const Ee=h2(de),ye=Math.max(0,Math.min(100,Math.floor(Math.min(Ee,G)/G*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):ou(de,v)}},[N,c,s,i,u,t?.durationDays,t?.code,v]),T=o.useRef(null),[M,L]=o.useState({}),[Q,H]=o.useState(null),O=!!(A||y||w),U=o.useRef(!1),$=o.useRef(void 0),[V,z]=o.useState(x);o.useLayoutEffect(()=>{z(x)},[x]),o.useLayoutEffect(()=>{const q=T.current;q&&(p!==void 0&&q.style.setProperty("--pass-card-text",p),f!==void 0&&q.style.setProperty("--pass-card-sub",f),b!==void 0&&q.style.setProperty("--pass-card-copyright",b))},[p,f,b]),o.useLayoutEffect(()=>{const q=T.current;if(!q)return;const G=e2(q);if(!x){const de=m2[k],Ee=c==="expired"?"_mono":G?.logoColor??"",ye=d2(de,Ee);z(ye)}},[d,x,k,c]);const Y=q=>{const G=T.current;if(!G)return null;const{left:de,top:Ee,width:ye,height:me}=G.getBoundingClientRect(),se=(q.clientX-de)/ye-.5;return{rotateX:-((q.clientY-Ee)/me-.5)*ru,rotateY:se*ru}},S=(q,G)=>{const de=G*-.7,Ee=q*.7+10,ye=20+(Math.abs(q)+Math.abs(G))*.4;return`${de}px ${Ee}px ${ye}px rgba(0, 0, 0, 0.18)`},R=o.useCallback(q=>{if(da())return;U.current=!0,clearTimeout($.current),$.current=setTimeout(()=>{U.current=!1},200);const G=Y(q);G&&L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),F=o.useCallback(q=>{if(da())return;const G=Y(q);if(!G)return;const de=U.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.rotateY),transition:de})},[]),Z=o.useCallback(()=>{clearTimeout($.current),U.current=!1,L({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),pe=o.useCallback(()=>H(null),[]),re=o.useMemo(()=>{const q=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),G=E.replace("\uC774\uC6A9\uAD8C","").replace(q==="\uC774\uC6A9\uAD8C"?"":q,"").trim(),de=G.match(/^(.*?)(일|년)$/);return de?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:de[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:de[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:G})},[E,v]),oe=o.useMemo(()=>{const q=ia(N);if(!q)return null;const G=q.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!G)return n.jsx("span",{className:"h1",children:q});const[,de,Ee,ye]=G;return n.jsxs(n.Fragment,{children:[de&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:de}),n.jsx("span",{className:"h1 pass-card__price-amount",children:Ee}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[N]),ne=o.useCallback(()=>{O&&H(q=>{if(q)return null;const G=T.current?.getBoundingClientRect();if(!G)return null;const de=50;return{left:G.left,right:G.right,width:G.width,height:G.height,x:G.x,y:G.y+de,top:G.top+de,bottom:G.bottom+de}})},[O]),W=o.useCallback(q=>{O&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),ne())},[O,ne]),ie=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),H(null)},closeOnSelect:!0}]:[],...y?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{y(),H(null)},closeOnSelect:!0}]:[],...w?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{w(),H(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:T,className:`pass-card pass-card--${c}${O?" pass-card--clickable":""}`,style:M,onMouseEnter:R,onMouseMove:F,onMouseLeave:Z,onPointerUp:q=>{q.pointerType==="touch"&&Z()},onPointerCancel:q=>{q.pointerType==="touch"&&Z()},onClick:ne,onKeyDown:O?W:void 0,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-label":e,"aria-haspopup":O?"menu":void 0,"aria-expanded":O?!!Q:void 0,children:[d??f2(k,E,D),!m&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:V??p2[k],className:"pass-card__logo",alt:k==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:re}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[P&&n.jsx("span",{className:"pass-card__discount body-3",children:P}),n.jsxs("div",{className:"pass-card__price",children:[I&&n.jsx("span",{className:"pass-card__price-original body-3",children:ia(I)}),oe]})]}):K?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:K.remainingLabel}),K.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:K.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Q&&n.jsx(hn,{anchorRect:Q,onClose:pe,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:ie,onClose:pe,size:"small"})})]})}const C2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function g2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Nt(C2,kn,An);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const b2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function y2(e={}){const t=Nt(b2,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${za}")`}})]})}function v2(e,t){if(e){if(t==="manager_pro")return n.jsx(y2,{});if(t==="manager_standard")return n.jsx(g2,{});if(t==="manager_lite")return n.jsx(au,{})}}function x2(e){const t=ia(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,l,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),l,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function _2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:l,onSelect:s,period:i="monthly",ownedCodes:u}=e||{},c=y=>!!y&&!!u?.includes(y),d=y=>y.onceOnly??/오픈\s*특가/.test(y.label??""),m=(l.tiers||[]).some(y=>d(y)&&c(y.code)),p=y=>{const w=y.prices?y.prices[i]:y.price;return w?(l.tiers||[]).some(v=>!!v.badge&&v.originals?.[i]===w):!1},f=l.colorToken?`var(--color-${l.colorToken})`:"var(--color-gray)",b=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=y=>y.prices?y.prices[i]:y.price,h=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB34\uB8CC"||w===b||w==="0\uC6D0"||typeof w=="string"&&/\d/.test(w)&&!/[1-9]/.test(w)}),_=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB38\uC758"||w===x}),g=l.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[l.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(Et,{label:l.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:f},children:l.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:l.tier??l.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:l.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(l.recommendedFor||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(l.features||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:h?null:_?n.jsx(fe,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>l.tiers?.[0]&&s?.({...l.tiers[0],productId:l.id,productTitle:l.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(l.tiers||[]).map(y=>{const w=y.label||a,v=d(y),B=v||y.openPromo===!0,k=w.replace(/^오픈\s*특가\s*/,"")||a,E=y.prices?y.prices[i]:y.price,D=y.badge?B?`${r}
822
+ and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",bizNo:"Business no.",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Sicheong-gil, Chuncheon, Gangwon, Korea",bizNoValue:"526-81-02926"},bb={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},yb={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount_one:"Downloading {{n}} word",downloadingCount_other:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},vb={clearAriaLabel:"Clear input"},xb={ariaLabel:"Select tab"},_b={ariaLabel:"Tabs"},wb={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},Bb={ariaLabel:"User avatar"},kb={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"}},Ab={weekly:{title:"Weekly Training",daily:"Daily Listening"},homework:{title:"Homework Progress",totalRate:"Overall rate",done:"Done"},today:{tooltipTotal:"Total",tooltipDone:"Done"},visit:{title:"Linked Visit Records"},detail:"Details",detailFor:"{{name}} details"},Nb={time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"}},Eb={steps:"Step {{current}} of {{total}}"},Db={skippedOnly_one:"{{n}} older record was excluded \u2014 it does not say what was answered.",skippedOnly_other:"{{n}} older records were excluded \u2014 they do not say what was answered.",runs_one:"{{count}} run",runs_other:"{{count}} runs"},Sb={resetColumns:"Reset column widths",scrollRegion:"Horizontally scrollable table",rowActionHint:"Press a row to open its details"},jb={viewWords:"Words"},Tb={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Mb={chooseDate:"Choose a date",selectYear:"Select year",selectMonth:"Select month"},Lb={previewRegion:"Report preview \u2014 scrollable sideways"},$b={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Rb={place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Pb={clearSelection:"Clear selection"},Ib={showResult:"Show {{type}} result"},Fb={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},Ob={loading:"Loading"},zb={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},Wb={ariaLabel:"Breadcrumb"},Hb={empty:"No items yet."},Vb={main:"Main gradient",soft:"Soft",sub:"Sub color",deep:"Deep gradient",softSub:"Soft sub",warm:"Warm (accent)",dark:"Dark",radial:"Radial gradient",diagonal:"Diagonal pattern",dots:"Dot pattern",outline:"Outline",success:"Success / done",naver:"Naver blog notice",instagram:"Instagram notice"},qb={common:Vg,calendar:qg,passCard:Ug,rating:Gg,colorPicker:Kg,dropdown:Yg,accordion:Zg,header:Xg,nav:Jg,settings:Qg,usage:eb,account:tb,training:nb,customers:ab,payment:rb,coupons:ob,visits:sb,trainingType:lb,myWordTable:ib,keyWords:ub,wordTable:cb,wordSearch:db,wordPrint:pb,topic:mb,device:hb,manager:fb,wordPairs:Cb,footer:gb,date:bb,wordData:yb,textField:vb,segmentedControl:xb,tabs:_b,fileUpload:wb,avatar:Bb,myHomework:kb,trainingStatus:Ab,store:Nb,progress:Eb,trainingMiss:Db,table:Sb,wordScore:jb,topBanner:Tb,datePicker:Mb,report:Lb,tooltip:$b,phonemeProfile:Rb,bulkBar:Pb,debug:Ib,badge:Fb,loader:Ob,soundCompass:zb,breadcrumb:Wb,board:Hb,promoBannerBg:Vb};const Ub="0.364.0",Gb=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],po="ko",Kb="ihab_display_language";function Gl(){if(typeof window>"u")return po;try{const e=localStorage.getItem(Kb);if(e&&Gb.some(t=>t.code===e))return e}catch{}return po}function Kl(e){try{document.documentElement.lang=e}catch{}}Rt.on("languageChanged",Kl),Kl(Gl()),Rt.use(xe.initReactI18next).init({resources:{ko:{translation:Hg},en:{translation:qb}},lng:Gl(),fallbackLng:po,interpolation:{escapeValue:!1},react:{useSuspense:!1}});const Yb=new Map;try{Rt.store?.on?.("added",()=>Yb.clear())}catch{}let or=null,Yl=null,Zl=null;function Zb(){const e=Rl();if(e&&e.entries.length>0){const t=iC();if(or&&Yl===e&&Zl===t)return or;const a=new Set,r=[];for(const l of e.entries)!l.word||a.has(l.word)||(a.add(l.word),r.push({w:l.word,s:l.syllables,p:t?.[l.word]?[...t[l.word].cho??[],...t[l.word].jung??[],...t[l.word].jong??[]]:[],pron:l.pronunciation||l.word,grade:l.grade}));return or=r,Yl=e,Zl=t,or}return[]}new Proxy([],{get(e,t){const a=Zb(),r=a[t];return typeof r=="function"?r.bind(a):r}});function Xb(e){if(e.includes("\\")&&e.includes("("))return!0;if(!/url\s*\(/i.test(e))return!1;const t=e.replace(/url\(\s*(['"]?)#[^)'"]*\1\s*\)/gi,"");return/url\s*\(/i.test(t)}function Jb(e){if(typeof window>"u")return"";const t=(a,r)=>{typeof r.attrValue=="string"&&Xb(r.attrValue)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","use","style"],FORBID_ATTR:["xlink:href","href"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function Qb(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),[s,i]=o.useState(null),[u,c]=o.useState(null),[d,m]=o.useState(null);return o.useEffect(()=>{if(!e||typeof e!="string"||!e.endsWith(".svg")){a(null),l(null),i(null),c(null);return}const p=e.split("/").pop();let f=e;p&&(e.startsWith("/")?f=Zr(e):/^(Logo|Symbol)/i.test(p)?f=Zr(`logo/${p}`):(/^https?:\/\//i.test(e)||e.startsWith("data:"),f=e)),i(null),c(null),a(e),l(f)},[e]),o.useEffect(()=>{if(!r)return;let p=!1;async function f(){try{let b=await fetch(r);b.ok||(b=await fetch(r));const x=b.headers.get("content-type")||"";if(p)return;if(x.includes("svg")){i("mask");return}if(x.startsWith("image/")){i("img");return}const C=await fetch(r);if(!C.ok)throw new Error("not ok");const h=await C.text();if(p)return;if(/^\s*<svg[\s>]/i.test(h)){const _=Jb(h);if(!_){i("none");return}c(_),i("inline");return}i("none")}catch{p||i("none")}}return f(),()=>{p=!0}},[r]),o.useEffect(()=>{let p=!1,f=null;return s==="mask"&&r&&fetch(r).then(b=>{if(!b.ok)throw new Error("fetch failed");return b.blob()}).then(b=>{p||(f=URL.createObjectURL(b),m(f))}).catch(()=>{p||i("img")}),()=>{p=!0,f&&URL.revokeObjectURL(f),m(null)}},[s,r]),t===e?{iconToUse:r,mode:s,svgText:u,blobUrl:d}:{iconToUse:null,mode:null,svgText:null,blobUrl:null}}function Qe(e){const{icon:t,label:a,className:r,imgClassName:l,maskClassName:s,svgClassName:i,wrapperStyle:u,size:c}=e||{},d=r??"iconRenderer-icon",m=l??"iconRenderer-icon-image",p=s??"iconRenderer-icon-mask",f=i??"iconRenderer-icon-svg",b=typeof t=="string"?t:null,x=W1(b),{iconToUse:C,mode:h,svgText:_,blobUrl:g}=Qb(b),A=(k,E={})=>n.jsx("span",{className:d,style:u,...E,children:k}),y=typeof c=="number"?{width:c,height:c,objectFit:"contain"}:null,w=(k,E={})=>n.jsx("img",{src:k,alt:typeof a=="string"?a:typeof a=="number"?String(a):"",className:m,...E,style:y?{...E.style,...y}:E.style});if(!t)return null;if(typeof t!="string")return A(t);if(t==="none")return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true"></svg>'}}),{"aria-hidden":"true"});if(x)try{return A(o.createElement(x,{className:f,size:typeof c=="number"?c:20}),{"aria-hidden":"true"})}catch{}if(C&&C.endsWith(".svg")){if(h==="mask"){const k={"--icon-url":g?`url(${g})`:`url(${C})`,...typeof c=="number"?{"--icon-size":`${c}px`}:null};return A(n.jsx("span",{className:p,style:k}),{"aria-hidden":"true"})}return h==="img"?A(w(C,{onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}}),{"aria-hidden":"true"}):h==="inline"?A(n.jsx("span",{className:f,dangerouslySetInnerHTML:_?{__html:_}:void 0}),{"aria-hidden":"true"}):A(null,{"aria-hidden":"true"})}if(t.startsWith("/")||t.includes("/assets/")||t.match(/\.(png|jpg|jpeg|webp|gif)$/i))return w(Zr(t),{style:u,onError:k=>{k.currentTarget.onerror=null,k.currentTarget.style.display="none"}});const v=typeof c=="number"?c:20,B=`<svg width="${v}" height="${v}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><rect x="3" y="3" width="18" height="18" rx="2" ry="2" style="fill:none;stroke:currentColor;stroke-width:2"/></svg>`;return A(n.jsx("span",{className:f,dangerouslySetInnerHTML:{__html:B}}),{"aria-hidden":"true"})}function Xl(e){const[t,a]=o.useState(!1),r=o.useRef(!1),l=o.useRef(!0);o.useEffect(()=>(l.current=!0,()=>{l.current=!1}),[]);const s=o.useCallback(()=>{if(!e||r.current)return;const i=e();if(i&&typeof i.then=="function"){r.current=!0,a(!0);const u=()=>{r.current=!1,l.current&&a(!1)};i.then(u,u)}},[e]);return{pending:t,press:s}}function ey({icon:e,title:t,message:a,action:r,className:l}){const{pending:s,press:i}=Xl(r?.onClick);return n.jsxs("div",{className:_e("empty-state",l),children:[e&&n.jsx(Qe,{icon:e,size:48,className:"empty-state__icon"}),t&&n.jsx("p",{className:"empty-state__title h4",children:t}),a&&n.jsx("p",{className:"empty-state__message body-3",children:a}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:i,disabled:s,"aria-busy":s||void 0,children:[r.icon&&n.jsx(Qe,{icon:r.icon,className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:r.label})]})]})}function ty({message:e,hint:t,icon:a="triangle-alert",onRetry:r,retryLabel:l,className:s}){const{t:i}=xe.useTranslation(),{pending:u,press:c}=Xl(r);return n.jsxs("div",{className:_e("empty-state","error-state",s),role:"alert",children:[n.jsx(Qe,{icon:a,size:48,className:"empty-state__icon error-state__icon"}),n.jsx("p",{className:"empty-state__message body-3",children:e??i("common.errorState.message",{defaultValue:"\uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."})}),t&&n.jsx("p",{className:"error-state__hint caption-1",children:t}),r&&n.jsxs("button",{type:"button",className:"empty-state__action button button40 button40--bar button--variant-main button--align-center button--shape-rounded",onClick:c,disabled:u,"aria-busy":u||void 0,children:[n.jsx(Qe,{icon:"rotate-cw",className:"button__icon"}),n.jsx("span",{className:"button__label button-1",children:l??i("common.errorState.retry",{defaultValue:"\uB2E4\uC2DC \uC2DC\uB3C4"})})]})]})}function ny({icon:e,title:t,description:a,cta:r,tone:l="main",disabled:s=!1,onClick:i,className:u=""}){const c=o.useId(),d=`${c}-title`,m=`${c}-desc`,p=`${c}-cta`,f=()=>{s||i?.()};return n.jsx("section",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,"aria-labelledby":d,"aria-describedby":`${m} ${p}`,onClick:f,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),f())},className:_e("action-card",`action-card--${l}`,s&&"action-card--disabled",u),children:n.jsxs("div",{className:"action-card__body",children:[n.jsx("span",{"aria-hidden":!0,className:"action-card__chip",children:n.jsx(Qe,{icon:e,size:34})}),n.jsxs("div",{className:"action-card__text",children:[n.jsx("h2",{id:d,className:"action-card__title",children:t}),n.jsx("p",{id:m,className:"action-card__desc",children:a})]}),n.jsxs("div",{className:"action-card__cta",children:[n.jsx("span",{id:p,children:r}),n.jsx("span",{"aria-hidden":!0,className:"action-card__arrow",children:n.jsx(Qe,{icon:"arrow-right",size:18})})]})]})})}function ay({as:e="div",className:t="",children:a,storage:r,...l}){r&&Sf({resolveUrl:r.resolveUrl,download:r.download??(()=>Promise.reject(new Error("[ihabdevteam-core] CoreScope: download resolver\uAC00 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."))),exists:r.exists,resolvePath:r.resolvePath,noiseBaseUrl:r.noiseBaseUrl,noiseFileGain:r.noiseFileGain});const s=_e("ihabdevteam-core-scope",t);return n.jsx(e,{className:s,...l,children:a})}function ry(e){if(e.closest('[aria-hidden="true"], [hidden], [inert]'))return!1;for(let t=e;t;t=t.parentElement){const a=window.getComputedStyle(t);if(a.display==="none"||a.visibility==="hidden"||a.visibility==="collapse")return!1}return!0}function mo(e,t=!0){o.useEffect(()=>{if(!t)return;const a=e.current;if(!a)return;const r=l=>{if(l.key!=="Tab")return;const s=Array.from(a.querySelectorAll(gn)).filter(ry);if(!s.length){l.preventDefault();return}const i=s[0],u=s[s.length-1],c=document.activeElement,d=c===a;l.shiftKey&&(c===i||d)?(l.preventDefault(),u.focus()):!l.shiftKey&&c===u&&(l.preventDefault(),i.focus())};return a.addEventListener("keydown",r),()=>a.removeEventListener("keydown",r)},[e,t])}const gn='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ho=new WeakMap;function fo(e,t){e&&ho.set(e,t)}function Co(e){let t=e;for(let a=0;t&&!t.isConnected&&a<10;a++){let r=t;for(;r&&!ho.has(r);)r=r.parentElement;if(!r)return t;t=ho.get(r)??null}return t}function Jl(e){return!(!e||!e.isConnected||e===document.body||typeof e.focus!="function"||e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e.closest('[inert],[aria-hidden="true"],[hidden]'))}function sr(e,t,a){const r=e?.isConnected?e:a?.isConnected?a:null;if(Jl(t)&&!(e&&e.contains(t)))return t.focus(),t;if(!r)return null;const l=Array.from(document.querySelectorAll(gn)).filter(c=>!(e&&e.contains(c))&&Jl(c));let s=null,i=null;for(const c of l)r.compareDocumentPosition(c)&Node.DOCUMENT_POSITION_PRECEDING?s=c:i||(i=c);const u=s??i;return u?.focus(),u}function oy({title:e="",lines:t=[],notices:a=null,children:r,variant:l="default",dismissible:s=!1,className:i=""}){const{t:u}=xe.useTranslation(),[c,d]=o.useState(!1),m=o.useRef(null),p=o.useCallback(()=>{const C=m.current;C&&C.contains(document.activeElement)&&sr(C),d(!0)},[]);if(c)return null;const f=`notice-box notice-box--${l} body-2 ${i}`.trim(),b=s&&n.jsx("button",{type:"button",className:"notice-box__dismiss",onClick:p,"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"});if(a&&Array.isArray(a)&&a.length)return n.jsxs("div",{className:f,role:"note",children:[a.map((C,h)=>n.jsxs("div",{className:"notice-box__inner",children:[C.title?n.jsx("span",{className:"notice-box__title body-3",children:C.title}):null,n.jsx("div",{className:"notice-box__body",children:C.lines&&C.lines.length?n.jsx("div",{children:C.lines.map((_,g)=>n.jsx("span",{className:"notice-box__line body-3",children:_},g))}):C.children??null})]},h)),b]});const x=e||t.length?n.jsxs("div",{className:"notice-box__inner",children:[e?n.jsx("span",{className:"notice-box__title body-1",children:e}):null,n.jsx("div",{className:"notice-box__body",children:t.length?n.jsx("ul",{children:t.map((C,h)=>n.jsx("li",{className:"notice-box__line",children:C},h))}):r})]}):n.jsx("div",{className:"notice-box__inner",children:r});return n.jsxs("div",{ref:m,className:f,role:"note",children:[x,b]})}const ua=[];let lr=!1;function Ql(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const t=ua[ua.length-1];t&&(e.stopPropagation(),t())}function Gn(e){return ua.push(e),!lr&&typeof document<"u"&&(document.addEventListener("keydown",Ql),lr=!0),()=>{const t=ua.lastIndexOf(e);t>=0&&ua.splice(t,1),ua.length===0&&lr&&typeof document<"u"&&(document.removeEventListener("keydown",Ql),lr=!1)}}const ei=o.createContext(null);function sy(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const ti=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function ly(e){const t=o.useCallback(a=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const r=window.matchMedia(e);return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]);return js.useSyncExternalStore(t,()=>ti(e),()=>!1)}function iy(e){const[t,a]=o.useState(ti(e));return o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const r=window.matchMedia(e),l=i=>a(i.matches),s=r;return s.addEventListener?s.addEventListener("change",l):s.addListener&&s.addListener(l),a(r.matches),()=>{s.removeEventListener?s.removeEventListener("change",l):s.removeListener&&s.removeListener(l)}},[e]),t}const uy=typeof js.useSyncExternalStore=="function"?ly:iy;function un(e){const t=o.useContext(ei),a=uy(e);return t&&typeof t.mobile=="boolean"&&sy(e)?t.mobile:a}const cy="(prefers-reduced-motion: reduce)";function go(){return un(cy)}function hn(e){const{anchorRect:t,anchorEl:a,offset:r=20,edgeMargin:l=20,onClose:s,closeOnOutsideClick:i=!0,className:u="",role:c="dialog",ariaLabel:d="",children:m,backdrop:p=!1,isMobilePopup:f=!1,useBorder:b=!0,header:x,focusOnOpen:C}=e||{},h=o.useRef(null),[_,g]=o.useState({position:"fixed",left:0,top:-9999}),[A,y]=o.useState(!1),[w,v]=o.useState("bottom"),[B,k]=o.useState(!1),[E,D]=o.useState(!1),N=!t&&!a,I=o.useCallback((U=!1)=>{if(E&&f)return;const $=a?a.getBoundingClientRect():t;if(!$||!h.current)return;const V=h.current,{offsetWidth:z,offsetHeight:Y}=V,S=window.innerWidth,R=window.innerHeight,F=S-$.right,Z=$.left,pe=$.top,re=R-$.bottom;let oe=0,ne=0,W="top";if(pe>=Y+r)W="top",ne=$.top-r-Y,oe=$.left+$.width/2-z/2;else if(re>=Y+r)W="bottom",ne=$.bottom+r,oe=$.left+$.width/2-z/2;else if(F>=z+r)W="right",oe=$.right+r,ne=$.top+$.height/2-Y/2;else if(Z>=z+r)W="left",oe=$.left-r-z,ne=$.top+$.height/2-Y/2;else{const de=Math.max(pe,re,F,Z);de===pe?(W="top",ne=$.top-r-Y,oe=$.left+$.width/2-z/2):de===re?(W="bottom",ne=$.bottom+r,oe=$.left+$.width/2-z/2):de===F?(W="right",oe=$.right+r,ne=$.top+$.height/2-Y/2):(W="left",oe=$.left-r-z,ne=$.top+$.height/2-Y/2)}const ie=Number.isFinite(Number(l))?Number(l):8;oe=Math.min(Math.max(oe,ie),S-z-ie),ne=Math.min(Math.max(ne,ie),R-Y-ie);const q=Math.round(oe),G=Math.round(ne);U&&h.current?(h.current.style.left=`${q}px`,h.current.style.top=`${G}px`,h.current.dataset.placement=W):(v(W||w),g({position:"fixed",left:q,top:G}),k(!0))},[E,f,a,t,r,l,w]);o.useLayoutEffect(()=>{if(N)return;if(E&&f){g({position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:"calc(100% - 40px)",maxWidth:"calc(100% - 40px)"}),k(!0);return}I();const U=requestAnimationFrame(()=>I());return()=>cancelAnimationFrame(U)},[t,a,r,m,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f||!h.current||typeof ResizeObserver>"u")return;const U=new ResizeObserver(()=>{t&&I()});return U.observe(h.current),()=>U.disconnect()},[t,m,l,N,E,f,I]),o.useEffect(()=>{if(N||E&&f)return;let U=null;const $=()=>{if(typeof requestAnimationFrame>"u"){I(!0);return}U===null&&(U=requestAnimationFrame(()=>{U=null,I(!0)}))},V=z=>{if(!a&&s){const Y=z.target;if(Y&&h.current&&h.current.contains(Y))return;try{if(Y&&Y.closest&&Y.closest("[data-tooltip-ignore]"))return}catch{}L.current(!0);return}$()};return window.addEventListener("resize",$),document.addEventListener("scroll",V,{passive:!0,capture:!0}),()=>{U!==null&&cancelAnimationFrame(U),window.removeEventListener("resize",$),document.removeEventListener("scroll",V,{capture:!0})}},[t,a,s,r,m,l,N,E,f,I]),o.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const U=window.matchMedia("(max-width: 768px)"),$=()=>D(!!U.matches);$();try{U.addEventListener?U.addEventListener("change",$):U.addListener($)}catch{try{U.addListener($)}catch{}}return()=>{try{U.removeEventListener?U.removeEventListener("change",$):U.removeListener($)}catch{}}},[]);const P=o.useRef(!1),K=o.useRef(null),T=go(),M=o.useCallback((U=!1)=>{if(s&&!(A||P.current)){if(P.current=!0,U){y(!0);try{s&&s()}catch{P.current=!1,y(!1)}return}y(!0),K.current=setTimeout(()=>{K.current=null;try{s&&s()}catch{P.current=!1,y(!1)}},T?0:200)}},[A,s,y,T]);o.useEffect(()=>()=>{K.current&&clearTimeout(K.current)},[]),o.useEffect(()=>{if(N)return;const U=z=>{const Y=h.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},$=z=>{const Y=h.current;if(!Y)return;const S=z.target;if(S&&!Y.contains(S)){try{if(S.closest&&S.closest("[data-tooltip-ignore]"))return}catch{}i&&M(!0)}},V=z=>{if(z.key==="Tab"){const Y=h.current;if(!Y)return;const S=Y.querySelectorAll(gn);if(!S||S.length===0)return;const R=S[0],F=S[S.length-1],Z=document.activeElement;z.shiftKey?Z===R&&(z.preventDefault(),F.focus()):Z===F&&(z.preventDefault(),R.focus())}};return document.addEventListener("pointerdown",U,!0),document.addEventListener("click",$,!0),document.addEventListener("keydown",V),()=>{document.removeEventListener("pointerdown",U,!0),document.removeEventListener("click",$,!0),document.removeEventListener("keydown",V)}},[s,i,M,N]);const L=o.useRef(M);o.useEffect(()=>{L.current=M});const Q=!!s;o.useEffect(()=>{if(!(N||!Q))return Gn(()=>L.current())},[N,Q]),o.useEffect(()=>{const U=()=>{M(!0)};return typeof document<"u"&&document.addEventListener("speechear-close-tooltips",U),()=>{typeof document<"u"&&document.removeEventListener("speechear-close-tooltips",U)}},[M]);const H=o.useRef(null);o.useEffect(()=>{if(N||C===!1||!B)return;const U=h.current;if(!U)return;const $=U.querySelector(gn);if($)return H.current=document.activeElement,$.focus(),()=>{const V=H.current;H.current=null,V&&document.contains(V)&&V.focus()}},[N,C,B]),o.useEffect(()=>{c==="dialog"&&!d&&St("tooltip-no-name",'[ihab/Tooltip] \uC774\uB984 \uC5C6\uB294 role="dialog" \uC785\uB2C8\uB2E4 \u2014 ariaLabel \uC744 \uC8FC\uC138\uC694. \uB0AD\uB3C5\uAE30\uAC00 "\uB300\uD654\uC0C1\uC790" \uB77C\uACE0\uB9CC \uC77D\uC2B5\uB2C8\uB2E4.')},[c,d]);const O=n.jsxs("div",{ref:h,className:`tooltip-content ${N?"tooltip-content--inline":""} ${b?"tooltip-content--bordered":""} ${A?"is-closing":""} ${u} ${E&&f?"is-mobile":""}`,role:c,"aria-label":d||void 0,style:N?{}:{..._,visibility:B?"visible":"hidden"},tabIndex:-1,"data-placement":w,"data-left":N?"":_.left,"data-top":N?"":_.top,"data-anchor-left":t?Math.round(t.left):"","data-anchor-top":t?Math.round(t.top):"","data-anchor-width":t?Math.round(t.width):"","data-anchor-height":t?Math.round(t.height):"",children:[x!=null&&n.jsx("div",{className:"tooltip-content__header h5",children:x}),m]});if(N||typeof document>"u")return O;if(p||E&&f){const U=n.jsxs("div",{className:"tooltip-portal",children:[n.jsx("div",{className:"tooltip-backdrop",onClick:()=>{i&&M(!0)}}),O]});return nn.createPortal(U,document.body)}return nn.createPortal(O,document.body)}function wn(e){const{anchorRect:t,text:a,offset:r=8,onClose:l,className:s="",ariaLabel:i}=e||{};return a?n.jsx(hn,{anchorRect:t,offset:r,onClose:l,closeOnOutsideClick:!1,className:`tooltip-info ${s}`,ariaLabel:i||a,children:n.jsx("div",{className:"tooltip-info__content body-3",children:a})}):null}function Kn(e){const{t}=xe.useTranslation(),{anchorRect:a,title:r,items:l,activeIndex:s=-1,showIndex:i=!0,onClose:u,offset:c=12,closeOnOutsideClick:d=!0}=e||{},m=(Array.isArray(l)?l:l?[l]:[]).map(p=>typeof p=="string"?{text:p}:p);return!m.length&&!r?null:n.jsx(hn,{anchorRect:a,offset:c,onClose:u,closeOnOutsideClick:d,useBorder:!1,className:"tooltip-description",ariaLabel:r||t("tooltip.description","\uC124\uBA85"),children:n.jsxs("div",{className:"tooltip-description__box",children:[r&&n.jsx("span",{className:"tooltip-description__title body-2",children:r}),n.jsx("ol",{className:"tooltip-description__items",children:m.map((p,f)=>n.jsxs("li",{className:`tooltip-description__item body-3${f===s?" tooltip-description__item--active":""}`,children:[i&&m.length>1&&n.jsxs("span",{className:"tooltip-description__index button-1",children:[f+1,"."]}),p.color&&n.jsx("span",{className:"tooltip-description__dot",style:{background:p.color},"aria-hidden":"true"}),n.jsx("span",{children:p.text})]},f))})]})})}function $a(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),t}let bo=0,ni=!1;function ai(){ni||typeof document>"u"||(ni=!0,document.addEventListener("pointerdown",e=>{e.pointerType==="touch"&&(bo=Date.now())},!0),document.addEventListener("touchstart",()=>{bo=Date.now()},{capture:!0,passive:!0}))}ai();function ca(e){return!!e&&e.pointerType==="touch"}function da(e=1e3){return ai(),Date.now()-bo<e}function yo(e,t,a,{enabled:r=!0,fallbackOnParent:l=!1}={}){const s=$a(e),i=$a(t),u=o.useRef(null),c=o.useRef(0);o.useEffect(()=>{if(!r||typeof document>"u")return;const m=p=>{const f=p,b=p.target,x=a.current,C=!!(b&&x&&x.contains(b));if(f.pointerType!=="touch"){C&&(u.current=null);return}if(C){u.current=s.current;return}u.current=null,s.current&&!(b&&b.closest?.(".tooltip-content"))&&i.current(!1,x)};return document.addEventListener("pointerdown",m,!0),()=>document.removeEventListener("pointerdown",m,!0)},[r,a,s,i]);const d=o.useCallback(m=>{const p=u.current;return p===null?!1:(u.current=null,c.current=Date.now(),i.current(!p,m??a.current),!0)},[a,i]);return o.useEffect(()=>{if(!r||!l)return;const m=a.current,p=m?.parentElement;if(!m||!p)return;let f=null;const b=h=>{const _=h.changedTouches?.[0];if(!_)return!1;const g=m.getBoundingClientRect();return _.clientX>=g.left&&_.clientX<=g.right&&_.clientY>=g.top&&_.clientY<=g.bottom},x=h=>{f=b(h)?s.current:null},C=h=>{const _=f;f=null,!(_===null||Date.now()-c.current<700||!b(h))&&(u.current=null,c.current=Date.now(),i.current(!_,m))};return p.addEventListener("touchstart",x,{passive:!0}),p.addEventListener("touchend",C),()=>{p.removeEventListener("touchstart",x),p.removeEventListener("touchend",C)}},[r,l,a,s,i]),{touchPress:d}}function dy(e,t){const{size:a=48,type:r,htmlType:l,href:s,target:i,rel:u,icon:c,rightIcon:d,label:m,count:p,subLabel:f,children:b,ariaLabel:x,variant:C="default",align:h="center",nowrap:_=!1,selected:g,toggleable:A=!1,ariaExpanded:y,ariaControls:w,disabled:v=!1,useLabel:B=!0,useBorder:k=!0,useBG:E=!0,useDisabledCovered:D=!1,useDisabledInvisible:N=!1,useDisabledFilled:I=!1,width:P,minWidth:K,onClick:T,onDisabledClick:M,showTooltipInfo:L=!1,tooltipInfoText:Q=null,tooltipDescription:H=null,tooltipOnly:O=!1,iconSize:U="medium",iconColor:$,shape:V="rounded",color:z,className:Y,...S}=e,R=typeof a=="string"&&isNaN(Number(a))?a.toLowerCase():String(Number(a)||48),F=R.match(/^\d+$/)?`button${R}`:`button-${R}`,Z=Number(a),pe=!isNaN(Z)&&Z<40?"button-2":"button-1",re=m??b,oe=v||!!S.disabled,ne=oe?D?"disabled-covered":N?"disabled-invisibled":I?"disabled-filled":"disabled":C,W=ne?`button--variant-${ne}`:"",ie=h?`button--align-${h}`:"",q=_?"button--nowrap":"",G=V?`button--shape-${V}`:"",de=typeof $=="string"&&$.startsWith("--")?`var(${$})`:$,Ee={...P?{width:typeof P=="number"?`${P}px`:P}:{},...K?{minWidth:typeof K=="number"?`${K}px`:K}:{},...k?{}:{"--button-border":oe?"0":"1px solid transparent"},...de?{"--button-icon-color":de}:{},...z?{"--color-main":z}:{}},ye=B===!1?"":re,me=Array.isArray(ye)?ye.length>0:!!ye,se=!!d,Ce=r??(me||c||se?"bar":"dot"),ge=`${F}--${Ce}`,ce=o.useRef(null);o.useEffect(()=>{!$n||l!==void 0||ce.current?.closest("form")&&St(`button-in-form:${typeof re=="string"?re:""}`,'[ihab/Button] <form> \uC548\uC778\uB370 htmlType \uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uC774 \uB2E8\uCD94\uB294 type="button" \uC774\uB77C \uD3FC\uC744 \uBCF4\uB0B4\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uBA74 htmlType="submit" \uC744 \uC8FC\uC138\uC694. \uD3FC\uC5D0 \uBCF4\uB0B4\uB294 \uB2E8\uCD94\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 **Enter \uB85C\uB3C4 \uC548 \uBCF4\uB0B4\uC9D1\uB2C8\uB2E4**(\uCE78\uC774 \uB458 \uC774\uC0C1\uC77C \uB54C).'+(typeof re=="string"&&re?` \uB2E8\uCD94: ${re}`:""))},[l,re]);const Me=o.useRef(t);Me.current=t;const Oe=o.useCallback(Pe=>{ce.current=Pe;const nt=Me.current;typeof nt=="function"?nt(Pe):nt&&(nt.current=Pe)},[]),Le=o.useRef(oe),[ze,We]=o.useState(!!g),[dt,lt]=o.useState(!1),[at,mt]=o.useState(null),Ae=o.useCallback(()=>lt(!1),[]),[qe,we]=o.useState(!1),Ue=o.useId();o.useEffect(()=>{typeof g=="boolean"&&We(g)},[g]),o.useEffect(()=>{if(Le.current&&!oe&&ce.current){const Pe=ce.current;let nt=!1;try{nt=Pe.matches(":focus:not(:focus-visible)")}catch{nt=!1}nt&&Pe.blur(),Pe.style.pointerEvents="none";const vt=requestAnimationFrame(()=>{requestAnimationFrame(()=>{ce.current&&(ce.current.style.pointerEvents="")})});return()=>cancelAnimationFrame(vt)}Le.current=oe},[oe]);const ke=typeof g=="boolean"?!!g:ze,$e=typeof y=="boolean"?void 0:A||typeof g=="boolean"?ke?"true":"false":S["aria-pressed"],je=_e("button",F,ge,W,ie,q,G,ke?"is-selected":null,E?null:"button--no-bg",O?"button--tooltip-only":null,Y),Ze=`button__icon button__icon--${U}`,yt=Array.isArray(f)?f:f!==void 0?[f]:[],et=()=>{if(Array.isArray(ye))return ye.map((nt,vt)=>{const Ge=yt[vt];return n.jsxs("span",{className:`button__label-text${Ge!==void 0?" button__label-text--has-sub":""}`,children:[nt,Ge!==void 0&&n.jsx("span",{className:"button__sub-label-text caption-1",children:Ge})]},vt)});const Pe=f!==void 0;return n.jsxs("span",{className:`button__label-text${Pe?" button__label-text--has-sub":""}`,children:[ye,p!=null&&n.jsx("span",{className:"button__count",children:p}),Pe&&n.jsx("span",{className:"button__sub-label-text caption-1",children:f})]})},Xe=Pe=>{typeof g!="boolean"&&!A&&We(!1),Pe.currentTarget.blur()},_t=Pe=>{oe||(typeof S.onMouseLeave=="function"&&S.onMouseLeave(Pe),Xe(Pe))},Ct=Pe=>{if(O&&ht&&rt.touchPress(Pe.currentTarget),oe){ht&&rt.touchPress(Pe.currentTarget),Pe.preventDefault(),M?.(Pe);return}typeof g!="boolean"&&A&&We(nt=>!nt),T?.(Pe)},wt=o.useCallback(()=>{(L||H)&&(lt(!0),mt(ce.current?.getBoundingClientRect()??null))},[L,H]),Bt=o.useCallback(()=>{(L||H)&&(lt(!1),mt(null))},[L,H]),ht=!!(L||H),rt=yo(dt,Pe=>{Pe?wt():Bt()},ce,{enabled:ht&&(oe||O),fallbackOnParent:ht&&oe}),te={...S};delete te.disabled,delete te.className,delete te.faded,delete te.useFaded,delete te.loading,delete te.onMouseLeave,delete te.onPointerEnter,delete te.onPointerLeave,delete te.onPointerUp,delete te.onFocus,delete te.onBlur,oe&&(Object.keys(te).forEach(Pe=>{/^on[A-Z]/.test(Pe)&&typeof te[Pe]=="function"&&delete te[Pe]}),te["aria-disabled"]="true");const Ne=(typeof L=="string"?L:null)??(typeof Q=="string"?Q:null)??(typeof x=="string"?x:null)??(typeof re=="string"?re:null)??void 0,Je=typeof x=="string"?x:typeof re=="string"?re:Ne,Ve=H?[H.title,...H.items??[]].filter(Boolean).join(". "):L&&Ne&&Ne!==Je?Ne:"",it=[typeof S["aria-describedby"]=="string"?S["aria-describedby"]:void 0,Ve?Ue:null].filter(Boolean).join(" ")||void 0,Se=(Pe,nt)=>n.jsx(Qe,{icon:Pe,label:nt??Je,className:Ze,imgClassName:"button__icon-img",maskClassName:"button__icon-mask",svgClassName:"button__icon-svg"}),pt=()=>Ce==="dot"?n.jsxs(n.Fragment,{children:[Se(c),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}):h==="center"&&c?n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"button__center-group",children:[n.jsx("span",{className:"button__left",children:Se(c)}),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()})]}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}):n.jsxs(n.Fragment,{children:[c&&n.jsx("span",{className:"button__left",children:Se(c,x??re)}),me&&n.jsx("span",{className:`button__label ${pe}`,children:et()}),se&&n.jsx("span",{className:"button__right",children:Se(d)})]}),gt=!!s&&!oe;return n.jsxs(n.Fragment,{children:[n.jsxs(gt?"a":"button",{...te,ref:Oe,...gt?{href:s,target:i,rel:u??(i==="_blank"?"noreferrer":void 0)}:{type:l??"button",disabled:oe&&!M&&!qe},className:je,"aria-pressed":$e,"aria-expanded":typeof y=="boolean"?y:S["aria-expanded"],"aria-controls":w??S["aria-controls"],"aria-label":Je,"aria-disabled":oe&&(gt||M||qe)?!0:void 0,"aria-describedby":it,style:Ee,onClick:Ct,onMouseLeave:_t,onPointerEnter:Pe=>{ca(Pe)||wt(),!oe&&typeof S.onPointerEnter=="function"&&S.onPointerEnter(Pe)},onPointerLeave:Pe=>{ca(Pe)||Bt(),!oe&&typeof S.onPointerLeave=="function"&&S.onPointerLeave(Pe)},onPointerUp:Pe=>{oe&&ht&&rt.touchPress(Pe.currentTarget),!oe&&typeof S.onPointerUp=="function"&&S.onPointerUp(Pe)},onFocus:Pe=>{we(!0),da()||wt(),!oe&&typeof S.onFocus=="function"&&S.onFocus(Pe)},onBlur:Pe=>{we(!1),oe||Xe(Pe),Bt(),!oe&&typeof S.onBlur=="function"&&S.onBlur(Pe)},children:[pt(),Ve?n.jsx("span",{id:Ue,hidden:!0,"aria-label":Ve}):null]}),dt&&H?n.jsx(Kn,{anchorRect:at,title:H.title,items:H.items,onClose:Ae}):dt&&Ne?n.jsx(wn,{anchorRect:at,text:Ne,onClose:Ae}):null]})}const fe=o.forwardRef(dy);fe.displayName="Button";function Nt(e,t,a){const r=o.useRef(null);return o.useLayoutEffect(()=>{const l=r.current?.parentElement??null;return t(l,e),()=>a(l)},[e,t,a]),r}const Ra={title:"--promo-banner-bg-title",description:"--promo-banner-bg-description"},vo=new WeakMap;function xo(e){if(e)return vo.get(e)}function Wt(e,t){e&&(e.style.setProperty(Ra.title,t.title),e.style.setProperty(Ra.description,t.description),vo.set(e,t))}function Ht(e){e&&(e.style.removeProperty(Ra.title),e.style.removeProperty(Ra.description),vo.delete(e))}const ri={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"default"};function oi(){const e=Nt(ri,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-main","aria-hidden":"true"})}const si={title:"var(--color-main)",description:"var(--color-gray)",actionVariant:"main"};function li(){const e=Nt(si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft","aria-hidden":"true"})}const ii={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function ui(){const e=Nt(ii,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-sub","aria-hidden":"true"})}const ci={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function di(){const e=Nt(ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-deep","aria-hidden":"true"})}const pi={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function mi(){const e=Nt(pi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-soft-sub","aria-hidden":"true"})}const hi={title:"var(--color-black)",description:"var(--color-darkGray)",actionVariant:"main"};function fi(){const e=Nt(hi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-warm","aria-hidden":"true"})}const Ci={title:"var(--color-white)",description:"var(--color-lightGray)",actionVariant:"main"};function gi(){const e=Nt(Ci,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dark","aria-hidden":"true"})}const bi={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function yi(){const e=Nt(bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-radial","aria-hidden":"true"})}const vi={title:"var(--color-darkMain)",description:"var(--color-gray)",actionVariant:"main"};function xi(){const e=Nt(vi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-diagonal","aria-hidden":"true"})}const _i={title:"var(--color-darkSub)",description:"var(--color-gray)",actionVariant:"main"};function wi(){const e=Nt(_i,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-dots","aria-hidden":"true"})}const Bi={title:"var(--color-black)",description:"var(--color-gray)",actionVariant:"main"};function ki(){const e=Nt(Bi,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-outline","aria-hidden":"true",children:n.jsx("span",{className:"promo-banner-bg-outline__dot"})})}const Ai={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"main"};function Ni(){const e=Nt(Ai,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-success","aria-hidden":"true"})}const Ei={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"sub"};function Di(){const e=Nt(Ei,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-naver","aria-hidden":"true"})}const Si={title:"#ffffff",description:"rgba(255, 255, 255, 0.85)",actionVariant:"transparent-white"};function ji(){const e=Nt(Si,Wt,Ht);return n.jsx("div",{ref:e,className:"promo-banner-bg promo-banner-bg-instagram","aria-hidden":"true"})}const Qt=(e,t,a)=>({key:e,get label(){return Rt.t(`promoBannerBg.${e}`,t)},textTone:a}),py=[Qt("main","\uBA54\uC778 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("soft","\uC18C\uD504\uD2B8","dark"),Qt("sub","\uC11C\uBE0C \uCEEC\uB7EC","light"),Qt("deep","\uB525 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("softSub","\uC18C\uD504\uD2B8 \uC11C\uBE0C","dark"),Qt("warm","\uC6DC(\uAC15\uC870)","dark"),Qt("dark","\uB2E4\uD06C","light"),Qt("radial","\uBC29\uC0AC\uD615 \uADF8\uB77C\uB514\uC5B8\uD2B8","light"),Qt("diagonal","\uB300\uAC01\uC120 \uD328\uD134","dark"),Qt("dots","\uB3C4\uD2B8 \uD328\uD134","dark"),Qt("outline","\uC544\uC6C3\uB77C\uC778","dark"),Qt("success","\uC131\uACF5/\uC644\uB8CC","light"),Qt("naver","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8 \uC548\uB0B4","light"),Qt("instagram","\uC778\uC2A4\uD0C0\uADF8\uB7A8 \uC548\uB0B4","light")],Ti={main:oi,soft:li,sub:ui,deep:di,softSub:mi,warm:fi,dark:gi,radial:yi,diagonal:xi,dots:wi,outline:ki,success:Ni,naver:Di,instagram:ji};function Mi({storageKey:e="fontScale",baseFont:t=20,minScale:a=.8,maxScale:r=1.4,step:l=.1,lineHeightRatio:s=1.4}={}){const i=A=>Math.max(a,Math.min(r,Number(A))),u=A=>{try{const y=localStorage.getItem(A),w=y?Number(y):1;return Number.isFinite(w)?i(w):i(1)}catch{return i(1)}},[c,d]=o.useState(()=>u(e)),[m,p]=o.useState(e);m!==e&&(p(e),d(u(e))),o.useEffect(()=>{try{localStorage.setItem(e,String(c))}catch{}},[e,c]);const f=A=>{d(typeof A=="function"?y=>i(A(y)):i(A))},b=()=>f(A=>+(A+l).toFixed(6)),x=()=>f(A=>+(A-l).toFixed(6)),C=c<r-Number.EPSILON,h=c>a+Number.EPSILON,_=Math.round(t*c),g=Math.round(_*s);return{scale:c,setScale:f,increase:b,decrease:x,canIncrease:C,canDecrease:h,fontSize:_,lineHeight:g}}function Li(e,t){const a=$a(t);o.useEffect(()=>{const r=()=>a.current();try{window.addEventListener(e,r)}catch{}return()=>{try{window.removeEventListener(e,r)}catch{}}},[e,a])}const _o=" \xB7 ",$i=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(_o)?e.split(_o).pop()??e:e})(),my=o.createContext(!1),Yn=[];let Ri=null;function hy(e){const t=o.useContext(my);o.useEffect(()=>{if(t||typeof e!="string"||!e)return;Yn.length===0&&(Ri=document.title);const a={text:$i?`${e}${_o}${$i}`:e};return Yn.push(a),document.title=a.text,()=>{const r=Yn.lastIndexOf(a);r>=0&&Yn.splice(r,1),document.title=Yn.length?Yn[Yn.length-1].text:Ri??document.title}},[e,t])}const wo=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}],fy=(()=>{let e=null;return()=>(e||(e=new Intl.Collator("ko")),e)})();function on(e,t){return fy().compare(e,t)}const ir=new Map;function Cy(e){const t=ir.get(e);if(t)return t;const a=[],r=/-?\d+(?:\.\d+)?/g;let l=0;for(let s=r.exec(e);s;s=r.exec(e)){let i=s.index,u=s[0];u[0]==="-"&&i>0&&!/\s/.test(e[i-1])&&(i+=1,u=u.slice(1)),i>l&&a.push(e.slice(l,i)),a.push(Number(u)),l=s.index+s[0].length}return l<e.length&&a.push(e.slice(l)),ir.size>5e3&&ir.clear(),ir.set(e,a),a}function gy(e){if(!/^[\d\s-]+$/.test(e))return null;const t=e.replace(/\D/g,"");return t.length<9||t.length>11?null:t[0]==="0"||t[0]==="1"&&e!==t?t:null}function by(e,t){const a=d=>d==null||typeof d=="number"&&Number.isNaN(d)?"":String(d).trim(),r=a(e),l=a(t);if(r===l)return 0;const s=(d,m)=>{if(typeof d=="number"&&!Number.isNaN(d))return[d];const p=gy(m);return p!==null?[p]:Cy(m)},i=s(e,r),u=s(t,l),c=Math.min(i.length,u.length);for(let d=0;d<c;d++){const m=i[d],p=u[d];if(typeof m=="number"&&typeof p=="number"){if(m!==p)return m-p;continue}if(typeof m=="number")return-1;if(typeof p=="number")return 1;const f=on(m,p);if(f!==0)return f}return i.length!==u.length?i.length-u.length:on(r,l)}const Pi=e=>e==null||typeof e=="number"&&Number.isNaN(e)||typeof e=="string"&&e.trim()==="";function Bo(e,t,a){const r=Pi(e),l=Pi(t);if(r||l)return r===l?0:r?1:-1;const s=by(e,t);return a?s:-s}function yy(e,t,a){const{t:r}=xe.useTranslation(),[l,s]=o.useState(()=>{const x=a?.initialPageSize;return x&&wo.some(C=>C.value===x)?x:"25"}),[i,u]=o.useState(1),[c,d]=o.useState(t);Object.is(c,t)||(d(t),i!==1&&u(1));const m=o.useMemo(()=>wo.map(x=>({...x,label:r("visits.showN",{n:x.value})})),[r]),p=o.useCallback(x=>{wo.some(C=>C.value===x)&&(s(x),u(1))},[]),f=Math.max(1,Math.ceil(e.length/Number(l))),b=Math.min(Math.max(1,Number.isFinite(i)?Math.floor(i):1),f);return i!==b&&u(b),{pageRows:o.useMemo(()=>e.slice((b-1)*Number(l),b*Number(l)),[e,b,l]),pageSizeProps:{options:m,value:l,onChange:p},paginationProps:{page:b,total:f,onChange:u},setPage:u}}function vy(e){const[t,a]=o.useState(null),r=o.useRef(t),l=o.useRef(e?.onSortChange);l.current=e?.onSortChange;const s=o.useCallback(c=>{const d=r.current,m=d?.key===c?{key:c,asc:!d.asc}:{key:c,asc:!0};r.current=m,a(m),l.current?.(m)},[]),i=o.useCallback((c,d)=>({label:c,sortDir:t?.key===d?t.asc?"asc":"desc":null,onClick:()=>s(d)}),[t,s]),u=o.useCallback((c,d)=>{if(!t)return c;const{key:m,asc:p}=t;return[...c].sort((f,b)=>Bo(d(f,m),d(b,m),p))},[t]);return{sort:t,field:i,sortRows:u}}const fn="\uC804\uCCB4";Object.fromEntries(Object.entries(Qf).map(([e,{nucleus:t}])=>[e,t]));const xy={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},_y={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},wy={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function By(e,t){if("place"in t)return xy[t.place](e);const a=_y[t.vowel](e);return t.glide?`${a} \xB7 ${wy[t.glide](e)}`:a}const ky=(e,{defaultValue:t})=>t,Ii=(e,t)=>({jamos:e,phonetic:t,tooltip:By(ky,t)}),Bn=(e,t)=>t.map(a=>Ii([a],{place:e})),Pt=(e,t,a)=>Ii([...e],a?{vowel:t,glide:a}:{vowel:t}),ko={cho:[Bn("labial",["\u3142","\u3143","\u314D","\u3141"]),Bn("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),Bn("alveolar",["\u3145","\u3146"]),Bn("palatal",["\u3148","\u3149","\u314A"]),Bn("velar",["\u3131","\u3132","\u314B"]),Bn("glottal",["\u314E"])],jung:[[Pt("\u3163","frontHigh"),Pt("\u315F","frontHigh","w"),Pt("\u3162","frontHigh","velar")],[Pt("\u3161","backHighUnrounded")],[Pt("\u315C","backHighRounded"),Pt("\u3160","backHighRounded","j")],[Pt("\u3154\u3150","frontMid"),Pt("\u3156\u3152","frontMid","j"),Pt("\u3159\u315A\u315E","frontMid","w")],[Pt("\u3153","backMidUnrounded"),Pt("\u3155","backMidUnrounded","j"),Pt("\u315D","backMidUnrounded","w")],[Pt("\u3157","backMidRounded"),Pt("\u315B","backMidRounded","j")],[Pt("\u314F","low"),Pt("\u3151","low","j"),Pt("\u3158","low","w")]],jong:[Bn("labial",["\u3142","\u3141"]),Bn("alveolar",["\u3137","\u3134","\u3139"]),Bn("velar",["\u3131","\u3147"])]},Ay=e=>e===Ny?[]:Array.from(e),Ny="__NO_CODA__",Ao=e=>e.map(t=>t.map(({jamos:a,phonetic:r,tooltip:l})=>({v:a.join(""),phonetic:r,tooltip:l}))),Fi={cho:Ao(ko.cho),jung:Ao(ko.jung),jong:Ao(ko.jong)};Fi.jung.flat().forEach(({v:e})=>{for(const t of Ay(e));}),new Set(Fi.cho.flat().map(e=>e.v));function Ey(e,t=!0){const a=$a(e);o.useEffect(()=>{if(t)return Gn(()=>{a.current?.()})},[t,a])}function Pa(){const[e,t]=o.useState(null),a=o.useCallback(s=>t(s.getBoundingClientRect()),[]),r=o.useCallback(()=>t(null),[]),l=o.useCallback(s=>{const i=s.getBoundingClientRect();t(u=>u?null:i)},[]);return{anchorRect:e,isOpen:e!=null,openAt:a,close:r,toggleAt:l}}function Dy(e){const[t,a]=o.useState(null),[r,l]=o.useState(null),s=o.useRef(null);o.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const i=o.useCallback((c,d)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{a(c),l(d)},e)},[e]),u=o.useCallback(()=>{s.current&&clearTimeout(s.current),a(null),l(null)},[]);return{payload:t,anchorRect:r,openAfterDelay:i,close:u}}function Oi(e="warning"){const[t,a]=o.useState(""),[r,l]=o.useState(e),[s,i]=o.useState(0),u=o.useCallback((p,f)=>{l(f),a(p),i(b=>b+1)},[]),c=o.useCallback(p=>u(p,"warning"),[u]),d=o.useCallback(p=>u(p,"normal"),[u]),m=o.useCallback(()=>a(""),[]);return{toastMessage:t,toastType:r,toastKey:s,showToast:u,showWarning:c,showNormal:d,clearToast:m}}function Ia(e){let t=0;if(e&&typeof window<"u"&&typeof window.getComputedStyle=="function")for(let a=e;a&&a!==document.body&&a!==document.documentElement;a=a.parentElement){const r=parseInt(window.getComputedStyle(a).zIndex,10);!Number.isNaN(r)&&r>t&&(t=r)}return t>0?`max(var(--z-menu, 1500), ${t+1})`:"var(--z-menu, 1500)"}function Fa({computeStyle:e,onScroll:t="close",onResize:a="close",ignoreOutsideClickSelector:r}){const[l,s]=o.useState(!1),[i,u]=o.useState({position:"fixed"}),c=o.useRef(null),d=o.useRef(null),m=o.useCallback(()=>{c.current&&u(e(c.current.getBoundingClientRect(),c.current))},[e]);o.useLayoutEffect(()=>{l&&m()},[l,m]),o.useEffect(()=>{if(!l)return;let b=d.current?.offsetHeight??0;b>0&&m();let x=0,C=null;typeof ResizeObserver<"u"&&d.current&&(C=new ResizeObserver(()=>{const B=d.current?.offsetHeight??0;if(B!==b){if(b=B,++x>4){C?.disconnect(),C=null;return}m()}}),C.observe(d.current));const h=B=>{const k=B.target;r&&k.closest?.(r)||c.current?.contains(k)||d.current?.contains(k)||s(!1)};document.addEventListener("mousedown",h),document.addEventListener("pointerdown",h);let _=null;const g=()=>{if(typeof requestAnimationFrame>"u"){m();return}_===null&&(_=requestAnimationFrame(()=>{_=null,m()}))},A=B=>{d.current?.contains(B.target)||(t==="reposition"?g():t==="close"&&s(!1))};t!=="ignore"&&window.addEventListener("scroll",A,!0);const y=()=>{a==="reposition"?g():a==="close"&&s(!1)};let w=null;const v=()=>{y(),w&&clearTimeout(w),w=setTimeout(()=>{w=null,a==="reposition"&&m()},250)};return a!=="ignore"&&(window.addEventListener("resize",y),window.addEventListener("orientationchange",v)),()=>{_!==null&&cancelAnimationFrame(_),C?.disconnect(),document.removeEventListener("mousedown",h),document.removeEventListener("pointerdown",h),t!=="ignore"&&window.removeEventListener("scroll",A,!0),a!=="ignore"&&(window.removeEventListener("resize",y),window.removeEventListener("orientationchange",v)),w&&clearTimeout(w)}},[l,m,t,a,r]),o.useEffect(()=>{if(l)return Gn(()=>s(!1))},[l]);const p=o.useCallback(()=>s(b=>!b),[]),f=o.useCallback(()=>s(!1),[]);return{open:l,setOpen:s,toggle:p,close:f,style:i,triggerRef:c,menuRef:d}}function Sy(e,{mode:t="playback",autoStart:a=!1,onPlaySpeaker:r,onComplete:l,playMs:s=1100,feedbackMs:i=1500}={}){const[u,c]=o.useState([]),[d,m]=o.useState(0),[p,f]=o.useState("idle"),[b,x]=o.useState(null),[C,h]=o.useState([]),[_,g]=o.useState(null),[A,y]=o.useState(0),w=o.useRef(0),v=o.useCallback($=>{w.current=typeof $=="function"?$(w.current):$,y(w.current)},[]),B=o.useRef(r),k=o.useRef(l);o.useEffect(()=>{B.current=r,k.current=l},[r,l]);const E=o.useRef([]),D=()=>{E.current.forEach(clearTimeout),E.current=[]},N=($,V)=>{E.current.push(setTimeout(V,$))};o.useEffect(()=>()=>D(),[]);const I=u[d]?.id??null,P=o.useRef(null),K=o.useCallback(()=>{D(),f("playing"),h([]),g(null),v(0);let $=0;e.forEach((V,z)=>{N($,()=>{m(z),x(V.id),B.current?.(V)}),N($+1e3,()=>{x(null),h(Y=>[...Y,V.id])}),$+=1300}),N($,()=>{f("done"),k.current?.({score:0,total:e.length})})},[e,v]),T=o.useCallback(($,V)=>{if(V>=$.length){f("done"),k.current?.({score:w.current,total:$.length});return}P.current=null,m(V),g(null),f("playing"),x($[V].id),B.current?.($[V]),N(s,()=>{x(null),f("waiting")})},[s]),M=o.useCallback(()=>{D();const $=Ta(e);c($),v(0),h([]),T($,0)},[e,T,v]),L=o.useCallback(()=>{t==="playback"?(c(e),K()):M()},[t,e,K,M]),Q=o.useCallback(()=>{D(),f("idle"),x(null),h([]),g(null),m(0),v(0),c([])},[v]),H=JSON.stringify(e.map($=>[$.id,$.label,$.angleDeg,$.deg,$.row,$.shortcut]));o.useEffect(()=>(a?L():Q(),()=>D()),[t,H,a]);const O=o.useCallback($=>{p!=="waiting"||t==="playback"||P.current===d||(P.current=d,g($),$===u[d]?.id&&v(V=>V+1),t==="exam"?(f("playing"),N(400,()=>T(u,d+1))):(f("feedback"),N(i,()=>T(u,d+1))))},[p,t,u,d,T,i,v]),U=t==="playback"?e.length:u.length;return{bind:{activeSpeakerId:b,playedIds:C,selectedId:_,answerId:I,showFeedback:p==="feedback",clickable:p==="waiting",onSelectSpeaker:O},index:d,total:U,score:A,phase:p,done:p==="done",start:L,reset:Q}}const No=new Map,Eo=new Map,jy=()=>()=>{},Ty=()=>!0,My=()=>!1;function zi(e){const t=/^data:image\/svg\+xml(;base64)?,([\s\S]*)$/.exec(e);if(!t)return null;try{if(!t[1])return decodeURIComponent(t[2]);const a=Uint8Array.from(atob(t[2]),r=>r.charCodeAt(0));return new TextDecoder("utf-8").decode(a)}catch{return null}}function Ly(e){if(typeof window>"u")return"";const t=(a,r)=>{const l=r.attrName.toLowerCase(),s=r.attrValue.trim();(l==="href"||l==="xlink:href")&&!s.startsWith("#")&&(r.keepAttr=!1),(l==="style"||s.includes("\\")&&s.includes("("))&&(r.keepAttr=!1);const i=s.replace(/url\s*\(\s*(['"]?)#[^)\s'"]+\1\s*\)/gi,"");/url\s*\(/i.test(i)&&(r.keepAttr=!1)};oa.addHook("uponSanitizeAttribute",t);try{return oa.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:["script","style","foreignObject"]})}finally{oa.removeHook("uponSanitizeAttribute",t)}}function $y(e,t){const a=new Set;for(const i of e.matchAll(/url\(\s*(['"]?)#([^)\s"']+)\1\s*\)/g))a.add(i[2]);for(const i of e.matchAll(/(?:xlink:)?href="#([^"]+)"/g))a.add(i[1]);const r=new Set([...e.matchAll(/id="([^"]*)"/g)].map(i=>i[1])),l=[...a].filter(i=>r.has(i));if(l.length===0)return e;let s=e;for(const i of l){const u=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=`${t}-${i}`;s=s.replace(new RegExp(`id="${u}"`,"g"),`id="${c}"`).replace(new RegExp(`url\\(\\s*(['"]?)#${u}\\1\\s*\\)`,"g"),(d,m)=>`url(${m}#${c}${m})`).replace(new RegExp(`((?:xlink:)?href)="#${u}"`,"g"),`$1="#${c}"`)}return s}function Ry(e){const t=Eo.get(e);if(t)return t;const a=fetch(e).then(r=>r.ok?r.text():null).then(r=>(r!=null&&No.set(e,r),r)).catch(()=>null).finally(()=>{Eo.delete(e)});return Eo.set(e,a),a}function Py(e,t=!0){const a=o.useSyncExternalStore(jy,Ty,My)&&t&&e?zi(e)??No.get(e)??null:null,[r,l]=o.useState({src:e,enabled:t,svg:a});return o.useEffect(()=>{if(!t||!e){l({src:e,enabled:t,svg:null});return}const s=zi(e)??No.get(e)??null;if(s!==null){l({src:e,enabled:t,svg:s});return}let i=!0;return Ry(e).then(u=>{i&&l({src:e,enabled:t,svg:u})}),()=>{i=!1}},[e,t]),r.src===e&&r.enabled===t?r.svg:a}function Iy({title:e,description:t,actionLabel:a,onAction:r,bg:l,color:s,size:i="medium",actionVariant:u,titleColor:c,descriptionColor:d,className:m=""}){const p=l??s??"main",f=o.useRef(null),[b,x]=o.useState("main"),C=un("(max-width: 767px)"),h=o.useRef({title:!1,description:!1});o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=xo(A),w=(v,B,k)=>{if(k!==void 0)A.style.setProperty(B,k),h.current[v]=!0;else if(h.current[v]){const E=y?.[v];E?A.style.setProperty(B,E):A.style.removeProperty(B),h.current[v]=!1}};w("title","--promo-banner-bg-title",c),w("description","--promo-banner-bg-description",d)},[c,d,p]),o.useLayoutEffect(()=>{const A=f.current;if(!A)return;const y=xo(A);x(y?.actionVariant??"main")},[p]);const _=_e("promo-banner",`promo-banner--${i}`,m),g=Ti[p];return n.jsxs("div",{ref:f,className:_,role:"note",children:[n.jsx(g,{}),n.jsxs("div",{className:"promo-banner__text",children:[n.jsx("span",{className:`promo-banner__title ${i==="small"?"body-2":"h2"}`,children:e}),t&&n.jsx("span",{className:"promo-banner__description body-3",children:t})]}),a&&r&&n.jsx(fe,{htmlType:"button",size:40,variant:u??b,shape:"pill",useBorder:!0,onClick:r,ariaLabel:a,...C?{type:"dot",icon:"arrow-right"}:{rightIcon:"arrow-right",label:a,minWidth:140}})]})}function Fy({children:e,interval:t=5e3,dotTone:a,className:r="","aria-label":l}){const{t:s}=xe.useTranslation(),i=l??s("topBanner.ariaLabel","\uBC30\uB108"),u=o.Children.toArray(e),c=u.length,[d,m]=o.useState(0),[p,f]=o.useState(!1),[b,x]=o.useState(!1),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=o.useRef(null),y=go(),w=p||b||C,v=c>0?Math.min(d,c-1):0;o.useEffect(()=>{if(c<2||t<=0||w||y)return;const k=window.setInterval(()=>m(E=>(Math.min(E,c-1)+1)%c),t);return()=>window.clearInterval(k)},[c,t,w,y]);const B=k=>{g.current!=null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null,h(!1)},k)};return o.useEffect(()=>()=>{g.current!=null&&window.clearTimeout(g.current)},[]),o.useEffect(()=>{if(!C)return;const k=E=>{E.pointerType==="touch"&&(A.current&&A.current.contains(E.target)||(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!1)))};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[C]),c===0?null:n.jsxs("section",{ref:A,className:_e("top-banner",r),"aria-label":i,"aria-roledescription":"carousel",onPointerEnter:k=>{_.current=k.pointerType},onPointerDown:k=>{_.current=k.pointerType,k.pointerType==="touch"&&(g.current!=null&&(window.clearTimeout(g.current),g.current=null),h(!0))},onPointerUp:k=>{k.pointerType==="touch"&&B(5e3)},onPointerCancel:k=>{k.pointerType==="touch"&&B(5e3)},onMouseEnter:()=>{_.current!=="touch"&&f(!0)},onMouseLeave:()=>f(!1),onFocus:k=>{let E=!0;try{E=k.target.matches(":focus-visible")}catch{E=!0}x(E)},onBlur:k=>{k.currentTarget.contains(k.relatedTarget)||x(!1)},children:[n.jsx("div",{className:"top-banner__viewport",children:n.jsx("div",{className:"top-banner__track",style:{transform:`translateX(-${v*100}%)`},children:u.map((k,E)=>n.jsx("div",{className:"top-banner__slide","aria-hidden":E!==v,...E!==v?{inert:!0}:{},children:k},E))})}),c>1&&n.jsx("div",{className:`top-banner__dots${(a?.[v]??"light")==="dark"?" top-banner__dots--dark":""}`,children:u.map((k,E)=>n.jsx("button",{type:"button",className:`top-banner__dot${E===v?" top-banner__dot--active":""}`,"aria-label":s("topBanner.dotAriaLabel",{count:c,index:E+1,defaultValue:`${c}\uAC1C \uC911 ${E+1}\uBC88\uC9F8 \uBC30\uB108`}),"aria-current":E===v,onClick:()=>m(E)},E))})]})}function Oy({title:e,body:t,open:a=!1,onToggle:r,avatar:l,titleClassName:s="body-2",bodyClassName:i="body-2",className:u=""}){const{t:c}=xe.useTranslation();return n.jsxs("div",{className:`accordion-item ${a?"accordion-item--open":""} ${u}`.trim(),role:"listitem",children:[n.jsxs("div",{className:"accordion-item__header",role:"button",tabIndex:0,"aria-expanded":a,"data-accordion-header":!0,onClick:r,onKeyDown:d=>{if(d.key==="Enter"||d.key===" ")d.preventDefault(),r?.();else if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault();const m=d.currentTarget.closest('[role="list"]');if(!m)return;const p=Array.from(m.querySelectorAll("[data-accordion-header]")),f=p.indexOf(d.currentTarget);(d.key==="ArrowDown"?p[f+1]:p[f-1])?.focus()}},children:[l&&n.jsx("div",{className:"accordion-item__avatar",children:l}),n.jsx("div",{className:`accordion-item__title ${s}`,children:e}),n.jsx("div",{className:"accordion-item__chevron",children:n.jsx(Qe,{icon:a?"chevron-up":"chevron-down",label:a?c("accordion.collapse","\uC811\uAE30"):c("accordion.expand","\uD3BC\uCE58\uAE30"),className:"accordion-item__chevron-icon",imgClassName:"accordion-item__chevron-image"})})]}),a&&n.jsx("div",{className:`accordion-item__body ${i}`,children:typeof t=="string"?n.jsx("p",{children:t}):t})]})}function zy({items:e=[],defaultOpenIndex:t=0,size:a=72,className:r="",bodyClassName:l}){const[s,i]=o.useState({index:t}),u=(c,d)=>s.id!=null&&c.id!=null?c.id===s.id:s.id==null&&d===s.index;return n.jsx("div",{className:`accordion-group accordion-group--s${a} ${r}`.trim(),role:"list",children:e.map((c,d)=>n.jsx(Oy,{title:c.title,body:c.body,avatar:c.avatar,open:u(c,d),onToggle:()=>i(u(c,d)?{index:-1}:{index:d,id:c.id}),bodyClassName:l},c.id??d))})}function Wy(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n.jsx("polyline",{points:"2,6 5,9 10,3"})})}function Hy(){return n.jsxs("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:[n.jsx("line",{x1:"3",y1:"3",x2:"9",y2:"9"}),n.jsx("line",{x1:"9",y1:"3",x2:"3",y2:"9"})]})}function Vy(){return n.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round","aria-hidden":"true",children:n.jsx("line",{x1:"2.5",y1:"6",x2:"9.5",y2:"6"})})}function Et(e){const{t}=xe.useTranslation(),{type:a="bar",size:r,className:l="","aria-label":s,"aria-hidden":i}=e;if(a==="dot"){const{icon:w,number:v,position:B="top-right",onClick:k,animate:E=!1}=e,D=w??"check",N=v!==void 0?"number":D,I=typeof r=="number"?r:32,P=_e("circle-badge",`circle-badge--${N}`,`circle-badge--${B}`,`circle-badge--${I}`,E?"circle-badge--animate":"",k?"circle-badge--clickable":"",l),K=v!==void 0?t("badge.nthSelected",{n:v,defaultValue:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"}):{check:t("badge.selected","\uC120\uD0DD\uB428"),remove:t("badge.remove","\uC81C\uAC70"),minus:t("badge.exclude","\uC81C\uC678")}[D];return n.jsxs("span",{className:P,onClick:k,onKeyDown:k?T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.currentTarget.click())}:void 0,"aria-label":i?void 0:s??K,"aria-hidden":i||void 0,role:k?"button":i?void 0:"img",tabIndex:k?0:void 0,children:[v!==void 0&&v,v===void 0&&D==="check"&&n.jsx(Wy,{}),v===void 0&&D==="remove"&&n.jsx(Hy,{}),v===void 0&&D==="minus"&&n.jsx(Vy,{})]})}const{label:u,children:c,variant:d="default",fill:m="filled",minWidth:p,iconLeft:f,iconRight:b,color:x}=e,C=typeof r=="number"?"medium":r??"medium",h={small:"caption-2b",medium:"body-3b",large:"body-2b"}[C]??"body-2b",_={small:12,medium:14,large:16}[C]??14,g=_e("badge",`badge--${d}`,`badge--${C}`,m!=="filled"?`badge--${m}`:"",h,l),A=x?.startsWith("--")?`var(${x})`:x,y=p!==void 0||A?{...p!==void 0?{minWidth:typeof p=="number"?`${p}px`:p}:{},...A?{"--badge-color":A}:{}}:void 0;return n.jsxs("span",{className:g,style:y,"aria-label":i?void 0:s,role:s&&!i?"img":void 0,"aria-hidden":i||void 0,children:[f&&n.jsx(Qe,{icon:f,size:_,className:"badge__icon"}),u??c,b&&n.jsx(Qe,{icon:b,size:_,className:"badge__icon"})]})}function Oa({columns:e=[],onClose:t,className:a="",size:r="medium"}){const{t:l}=xe.useTranslation(),s=r==="small"?40:48,[i,u]=o.useState([]),c=o.useMemo(()=>{const h=[{title:null,columns:e}];let _=e;for(const g of i){const A=_?.[g.ci]?.items?.[g.ii];if(!A||!Array.isArray(A.children)||!A.children.length)break;_=[{title:null,items:A.children}],h.push({title:A.label||null,columns:_})}return h},[e,i]),d=c[c.length-1],m=c.length-1,p=o.useCallback(()=>u(h=>h.slice(0,Math.max(0,Math.min(h.length,m)-1))),[m]),f=o.useRef(null),b=o.useRef(null),x=c.length;o.useEffect(()=>{b.current||(b.current=document.activeElement);let h=0,_=0;const g=()=>{const A=f.current?.querySelector("button:not([disabled])");if(A&&A.offsetParent){A.focus({preventScroll:!0});return}_++<20&&(h=requestAnimationFrame(g))};return h=requestAnimationFrame(g),()=>cancelAnimationFrame(h)},[x]),o.useEffect(()=>()=>{b.current?.focus?.({preventScroll:!0})},[]);const C=o.useCallback((h,_,g)=>{if(h){if(Array.isArray(h.children)&&h.children.length){u(A=>[...A.slice(0,m),{ci:_,ii:g}]);return}try{typeof h.onClick=="function"&&h.onClick()}catch{}try{h&&h.closeOnSelect&&typeof t=="function"&&t()}catch{}}},[t,m]);return n.jsxs("div",{className:`tooltip-menu tooltip-menu--${r} ${a}`,children:[(c.length>1||d.title)&&n.jsxs("div",{className:"tooltip-menu__header",children:[c.length>1?n.jsx(fe,{htmlType:"button",size:s,type:"dot",icon:"chevron-left",ariaLabel:l("common.back","\uB4A4\uB85C"),onClick:p,variant:"transparent-gray",useBorder:!1}):null,n.jsx("div",{className:"tooltip-menu__title button-1",children:d.title})]}),n.jsx("div",{className:"tooltip-menu__columns",ref:f,children:d.columns&&d.columns.map((h,_)=>n.jsxs("div",{className:"tooltip-menu__column",children:[h.title?n.jsx("div",{className:"tooltip-menu__column-title body-3",children:h.title}):null,n.jsx("div",{className:"tooltip-menu__items",children:(h.items||[]).map((g,A)=>n.jsxs(o.Fragment,{children:[g.separatorBefore&&A>0&&n.jsx("div",{className:"tooltip-menu__separator",role:"separator"}),n.jsx(fe,{htmlType:"button",className:"tooltip-menu__item",size:s,type:g.label?"bar":"dot",icon:g.selected?"check":g.icon||"none",rightIcon:Array.isArray(g.children)&&g.children.length?"chevron-right":g.badgeCount?n.jsx(Et,{type:"dot",position:"inline",number:Math.min(g.badgeCount,99),size:24,"aria-hidden":!0}):void 0,label:g.label,ariaLabel:g.label&&g.badgeCount&&g.badgeCount>0?l("nav.badgeLabel",{label:g.label,count:g.badgeCount,defaultValue:"{{label}}, {{count}}\uAC1C"}):g.label,onClick:()=>C(g,_,A),selected:g.selected,disabled:g.disabled,showTooltipInfo:g.tooltip||!1,useBorder:!1,align:"left"})]},A))})]},_))})]})}const Wi=".content-area";function Do(e,t="Nav"){try{const a=typeof e=="string"?document.querySelector(e):e?.current??document.querySelector(Wi);if(a){a.scrollTop=0;return}const r=document.scrollingElement??document.documentElement;r&&r.scrollHeight<=r.clientHeight&&St("nav-scroll-container",`[${t}] \uBCF8\uBB38\uC744 \uB9E8 \uC704\uB85C \uB418\uB3CC\uB9B4 \uD1B5\uC744 \uBABB \uCC3E\uC558\uB2E4(\uAE30\uBCF8 ${Wi}) \u2014 \uCC3D\uB3C4 \uAD6C\uB97C \uC218 \uC5C6\uC5B4 \uC544\uBB34 \uC77C\uB3C4 \uD558\uC9C0 \uC54A\uB294\uB2E4. scrollContainer \uB85C \uD1B5\uC744 \uC54C\uB824 \uC900\uB2E4.`),window.scrollTo({top:0})}catch{}}const So=52,ur=10,Hi=e=>e&&e>0?e:0;function Vi({items:e=[],activeKey:t,onChange:a,appMode:r,onAppModeChange:l,moreItems:s=[],scrollContainer:i}){const{t:u}=xe.useTranslation(),c=r==="manager"?"malgwi":"manager",d=r==="manager"?"arrow-left":"arrow-right",m=r==="manager"?u("nav.modeLabelMalgwi","\uB9D0\uADC0"):u("nav.modeLabelManager","\uB9D0\uADC0 \uB9E4\uB2C8\uC800"),p=o.useRef(null),[f,b]=o.useState(0),x=e.length;o.useEffect(()=>{const $=p.current;if(!$)return;const V=()=>{const S=typeof getComputedStyle=="function"?getComputedStyle($):null,R=$.clientWidth-(parseFloat(S?.paddingLeft??"")||0)-(parseFloat(S?.paddingRight??"")||0),F=$.querySelector(".bottom-nav__left"),Z=F?.nextElementSibling,pe=(F?.offsetWidth??0)+(F&&Z?.classList.contains("bottom-nav__divider")?Z.offsetWidth:0);b(Math.max(0,R-pe))};if(V(),typeof ResizeObserver>"u")return;const z=new ResizeObserver(V);z.observe($);const Y=$.querySelector(".bottom-nav__left");return Y&&z.observe(Y),()=>z.disconnect()},[l]);const C=So+1,h=$=>Math.max(0,Math.floor(($+ur)/(So+ur))),_=x*(So+ur)-ur<=f,g=f<=0||s.length===0&&_?x:Math.min(x,h(f-C)),A=f>0&&g<x,y=A?g:x,w=e.slice(0,y),v=e.slice(y),B=A||s.length>0,k=o.useCallback(($,V)=>({position:"fixed",bottom:window.innerHeight-$.top+8,right:window.innerWidth-$.right,zIndex:Ia(V)}),[]),E=o.useId(),{open:D,toggle:N,close:I,style:P,triggerRef:K,menuRef:T}=Fa({computeStyle:k,onScroll:"ignore",onResize:"reposition"}),M=o.useCallback(($,V)=>V>0?u("nav.badgeLabel",{label:$,count:V,defaultValue:"{{label}}, {{count}}\uAC1C"}):$,[u]),L=o.useCallback(($,V)=>V>0?u("nav.badgeInsideLabel",{label:$,count:V,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):$,[u]),Q=o.useCallback(()=>l?.(c),[l,c]),H=o.useMemo(()=>v.find($=>!!$.key&&$.key===t)??s.find($=>$.selected||$.key&&$.key===t),[v,t,s]),O=o.useMemo(()=>[{items:[...v.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:!!$.key&&$.key===t,closeOnSelect:!0,disabled:$.state==="disabled",onClick:()=>{$.state!=="disabled"&&($.key&&a&&(a($.key),Do(i,"BottomNav")),I())}})),...s.map($=>({label:$.label,icon:$.icon,badgeCount:$.badgeCount,selected:$.selected??(!!$.key&&$.key===t),closeOnSelect:!0,onClick:()=>{$.onClick?.(),I()}}))]}],[v,s,t,a,I]),U=[...v,...s].reduce(($,V)=>$+Hi(V.badgeCount),0);return n.jsxs("nav",{className:"bottom-nav",ref:p,"aria-label":u("nav.bottomNav","\uD558\uB2E8 \uB124\uBE44\uAC8C\uC774\uC158"),children:[l&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__left",children:n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:d,ariaLabel:m,className:"bottom-nav-item",onClick:Q})}),n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"})]}),n.jsx("div",{className:"bottom-nav__items",children:w.map(($,V)=>{const z=Hi($.badgeCount);return n.jsxs("span",{className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:$.icon,ariaLabel:M($.label,z),selected:!!$.key&&$.key===t,disabled:$.state==="disabled",className:"bottom-nav-item",onClick:()=>{$.key&&(a?.($.key),Do(i,"BottomNav"))}}),z>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(z,99),size:24})})]},$.key??`__slot-${V}`)})}),B&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"bottom-nav__divider","aria-hidden":"true"}),n.jsx("div",{className:"bottom-nav__right",children:n.jsxs("div",{ref:K,className:"bottom-nav__slot",children:[n.jsx(fe,{htmlType:"button",size:52,type:"dot",icon:H?.icon??"ellipsis",ariaLabel:L(H?.label??u("nav.more","\uB354\uBCF4\uAE30"),U),selected:!!H,className:"bottom-nav-item",onClick:N,"aria-expanded":D,"aria-controls":D?E:void 0}),U>0&&n.jsx("span",{"aria-hidden":"true",children:n.jsx(Et,{type:"dot",position:"top-right",number:Math.min(U,99),size:24})}),D&&nn.createPortal(n.jsx("div",{id:E,role:"group","aria-label":u("nav.moreMenu","\uB354\uBCF4\uAE30 \uBA54\uB274"),className:"tooltip-content",style:P,ref:T,children:n.jsx(Oa,{columns:O,onClose:I})}),document.body)]})})]})]})}function qi(e){if(typeof e!="string")return!1;let t="";for(const r of e){const l=r.charCodeAt(0);l<=32||l>=127&&l<=159||(t+=r)}if(!t)return!1;const a=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);return a?["http","https","mailto","tel"].includes(a[1].toLowerCase()):!0}function Ui(e,t,a){return a&&a>0?e("nav.badgeLabel",{label:t,count:a,defaultValue:"{{label}}, {{count}}\uAC1C"}):t}function qy(e){const{t}=xe.useTranslation(),{activeKey:a,unreadCount:r,onDebug:l,onNotification:s,onSetting:i,onHelp:u,onFeedback:c,onAccount:d}=e||{},m="default";return l||s||i||u||c||d?n.jsxs("div",{className:"side-nav__footer",children:[l&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"terminal",ariaLabel:t("nav.debug","\uB514\uBC84\uADF8"),onClick:l,selected:a==="debug"}),s&&n.jsxs("span",{className:"side-nav__notification-wrap",children:[n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bell",ariaLabel:Ui(t,t("nav.notifications","\uC54C\uB9BC"),r),onClick:s,selected:a==="notifications"}),!!r&&r>0&&n.jsx(Et,{type:"dot",number:Math.min(r,99),size:24,"aria-hidden":!0})]}),i&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"settings",ariaLabel:t("nav.settings","\uC124\uC815"),onClick:i,selected:a==="settings"}),u&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"message-circle-question-mark",ariaLabel:t("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:u,selected:a==="help"}),c&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"bug",ariaLabel:t("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:c,selected:a==="feedback"}),d&&n.jsx(fe,{htmlType:"button",size:48,showTooltipInfo:!0,type:"dot",shape:"pill",variant:m,icon:"user-round",ariaLabel:t("nav.account","\uACC4\uC815"),onClick:d,selected:a==="account"})]}):null}function Gi(e){const{t}=xe.useTranslation(),{item:a,itemKey:r,label:l,icon:s,active:i,onClick:u,style:c,state:d,labelStyle:m}=e||{},p=a?.key??r??"",f=a?.label??l??"",b=a?.icon??s??"",x=a?.badge??0,C=n.jsx("span",{className:"side-nav__icon-wrap",children:n.jsx(Qe,{icon:b,label:typeof f=="string"?f:void 0,className:"side-nav__icon",maskClassName:"side-nav__icon-image",imgClassName:void 0,svgClassName:void 0})}),h=d==="disabled",_=`side-nav__item ${i?"active":""} ${d||""} ${h?"disabled":""} ${a?.child?"side-nav__item--child":""}`,g=o.useCallback(A=>{if(h)return;const y=A.detail>0;if(y)try{A.currentTarget.blur()}catch{}u?.(p,A.currentTarget,y)},[h,p,u]);return n.jsxs("button",{type:"button",className:_,onClick:g,"aria-label":typeof f=="string"?Ui(t,f,x):void 0,"aria-current":i?"page":void 0,style:c,"aria-disabled":h,children:[C,n.jsx("span",{className:"side-nav__label button-1 f",style:m,children:f}),x>0&&n.jsx(Et,{type:"dot",position:"inline",number:Math.min(x,99),size:24,"aria-hidden":!0}),d==="loading"&&n.jsx("span",{className:"side-nav__spinner",role:"img","aria-label":t("loader.loading","\uBD88\uB7EC\uC624\uB294 \uC911\u2026")})]})}function Ki(e){const{t}=xe.useTranslation(),{items:a=[],activeKey:r,onChange:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}=e||{},C=f==="manager",h=o.useCallback(()=>b?.(C?"malgwi":"manager"),[b,C]),_=o.useRef(null),[g,A]=o.useState(null);o.useEffect(()=>{const k=_.current;if(!k)return;let E=null;const D=()=>{const{scrollHeight:P,clientHeight:K,scrollTop:T}=k;if(P<=K+1){A(O=>O===null?O:null);return}const M=Math.max(24,K/P*K),L=K-M,Q=P-K,H={top:Math.round(T/Q*L),height:Math.round(M)};A(O=>O&&O.top===H.top&&O.height===H.height?O:H)},N=()=>{if(typeof requestAnimationFrame>"u"){D();return}E===null&&(E=requestAnimationFrame(()=>{E=null,D()}))};D(),k.addEventListener("scroll",N,{passive:!0});const I=typeof ResizeObserver<"u"?new ResizeObserver(N):null;I?.observe(k);for(const P of Array.from(k.children))I?.observe(P);return()=>{E!==null&&cancelAnimationFrame(E),k.removeEventListener("scroll",N),I?.disconnect()}},[a]);const y=o.useRef(null),w=o.useCallback(k=>{const E=_.current;E&&(k.preventDefault(),y.current={y:k.clientY,top:E.scrollTop},k.currentTarget.setPointerCapture(k.pointerId))},[]),v=o.useCallback(k=>{const E=_.current,D=y.current;!E||!D||(E.scrollTop=D.top+(k.clientY-D.y)*(E.scrollHeight/E.clientHeight))},[]),B=o.useCallback(k=>{y.current=null,k.currentTarget.hasPointerCapture(k.pointerId)&&k.currentTarget.releasePointerCapture(k.pointerId)},[]);return n.jsxs("nav",{ref:_,"aria-label":t("nav.mainMenu","\uBA54\uC778 \uBA54\uB274"),className:"side-nav__menu",children:[g&&n.jsx("div",{className:"side-nav__scroll","aria-hidden":"true",children:n.jsx("div",{className:"side-nav__scroll-thumb",style:{top:g.top,height:g.height},onPointerDown:w,onPointerMove:v,onPointerUp:B,onPointerCancel:B})}),n.jsxs("div",{className:"side-nav__menu-list",children:[(a||[]).filter(k=>!k.section&&(k.key||k.label)).map((k,E)=>n.jsxs(o.Fragment,{children:[k.divider&&n.jsx("div",{className:"side-nav__separator"}),n.jsx(Gi,{item:k,active:!!k.key&&k.key===r,state:k.disabled?"disabled":void 0,onClick:(D,N,I)=>{if(k.disabled)return;if(k.href){if(qi(k.href)&&window.open(k.href,"_blank","noopener,noreferrer"),I)try{N?.blur()}catch{}return}if(l?.(k.key),Do(x,"SideNav"),!I)return;try{N?.blur()}catch{}if(typeof window<"u"&&window.matchMedia){if(!window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches)return}else return;const P=document.querySelector(".header");if(P){const K=typeof P.matches=="function";if(!(window.matchMedia("(hover: hover)").matches&&K&&P.matches(":hover"))){P.classList.add("header--force-collapsed");const T=()=>{P.classList.remove("header--force-collapsed"),P.removeEventListener("mouseenter",T)};P.addEventListener("mouseenter",T)}}}})]},k.key??`side-nav__item-${E}`)),b&&n.jsx("div",{className:"side-nav__separator side-nav__separator--short"}),b&&n.jsx(Gi,{item:{key:"__mode-switch__",label:C?t("nav.goToMalgwi","\uB9D0\uADC0\uB85C \uC774\uB3D9"):t("nav.goToManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800\uB85C \uC774\uB3D9"),icon:C?"arrow-left":"arrow-right"},onClick:h})]}),n.jsx(qy,{activeKey:r,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p})]})}var cr='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',jo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z"/></g><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Uy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_SpeechEar" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><g id="symbol"><path d="M183.92,56.08c-8.48-15.54-24.97-26.08-43.92-26.08h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%234dcdc0"/><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23499cdf"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>';function Yi({appMode:e}){const{t}=xe.useTranslation(),a=e==="manager",r=a?jo:cr,l=Uy;return n.jsxs("div",{className:"brand-identity__root","aria-label":t("header.biArea","BI \uC601\uC5ED"),children:[n.jsx("img",{src:l,alt:t("header.biSymbol","BI \uC2EC\uBCFC"),className:"brand-identity__image brand-identity__image--symbol"}),n.jsx("img",{src:r,alt:a?t("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):t("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0"),className:"brand-identity__image brand-identity__image--logo"})]})}function Zi({activeKey:e,onChange:t,items:a,malgwiItems:r,managerItems:l,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b,scrollContainer:x}){const{t:C}=xe.useTranslation(),h=un("(max-width: 767px)"),_=o.useMemo(()=>(a??[]).filter(P=>!P.section&&(P.key||P.label)).map(P=>({key:P.key,label:typeof P.label=="string"?P.label:void 0,icon:P.icon,state:P.disabled?"disabled":void 0,badgeCount:P.badge})),[a]),g=o.useCallback(P=>{const K=a?.find(T=>T.key===P);if(!K?.disabled){if(K?.href){qi(K.href)&&window.open(K.href,"_blank","noopener,noreferrer");return}t?.(P)}},[a,t]),A=o.useMemo(()=>{const P=[];return i&&P.push({key:"debug",icon:"terminal",label:C("nav.debug","\uB514\uBC84\uADF8"),onClick:i}),u&&P.push({key:"notifications",icon:"bell",label:C("nav.notifications","\uC54C\uB9BC"),badgeCount:s,onClick:u}),d&&P.push({key:"settings",icon:"settings",label:C("nav.settings","\uC124\uC815"),onClick:d}),m&&P.push({key:"help",icon:"message-circle-question-mark",label:C("nav.help","\uB3C4\uC6C0\uB9D0"),onClick:m}),p&&P.push({key:"feedback",icon:"bug",label:C("nav.feedback","\uBC84\uADF8\uC2E0\uACE0"),onClick:p}),c&&P.push({key:"account",icon:"user-round",label:C("nav.account","\uACC4\uC815"),onClick:c}),P},[C,i,u,d,m,p,c,s]),y=o.useCallback((P,K)=>({position:"fixed",top:P.bottom+8,right:Math.max(8,window.innerWidth-P.right),zIndex:Ia(K)}),[]),w=o.useId(),{open:v,toggle:B,close:k,style:E,triggerRef:D,menuRef:N}=Fa({computeStyle:y,onScroll:"ignore",onResize:"reposition"}),I=o.useMemo(()=>[{items:A.map(P=>({label:P.label,icon:P.icon,badgeCount:P.badgeCount,selected:P.selected??(!!P.key&&P.key===e),closeOnSelect:!0,onClick:()=>{P.onClick?.(),k()}}))}],[A,e,k]);return n.jsxs("aside",{className:`header${f==="manager"?" header--manager":""}`,children:[n.jsxs("div",{className:"header__bi",children:[n.jsx(Yi,{appMode:f}),n.jsxs("div",{className:"header__menu-button",ref:D,children:[n.jsx(fe,{htmlType:"button",size:48,type:"dot",shape:"pill",variant:"default",useBorder:!1,icon:"menu",ariaLabel:u&&s&&s>0?C("nav.badgeInsideLabel",{label:C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),count:s,defaultValue:"{{label}}, \uC548\uC5D0 \uC54C\uB9BC {{count}}\uAC1C"}):C("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),onClick:B,"aria-expanded":v,"aria-controls":v?w:void 0}),!!u&&!!s&&s>0&&n.jsx(Et,{type:"dot",number:Math.min(s,99),size:24,"aria-hidden":!0}),v&&nn.createPortal(n.jsx("div",{id:w,role:"group","aria-label":C("header.utilMenu","\uC720\uD2F8\uB9AC\uD2F0 \uBA54\uB274"),className:"tooltip-content",style:E,ref:N,children:n.jsx(Oa,{columns:I,onClose:k})}),document.body)]})]}),n.jsx(Ki,{scrollContainer:x,items:a,activeKey:e??void 0,onChange:t,unreadCount:s,onDebug:i,onNotification:u,onAccount:c,onSetting:d,onHelp:m,onFeedback:p,appMode:f,onAppModeChange:b}),h&&n.jsx(Vi,{items:_,activeKey:e??void 0,onChange:g,scrollContainer:x,appMode:f,onAppModeChange:b})]})}const Gy=Zi,Ky=()=>Rt.t("passCard.planSuffix","\uC774\uC6A9\uAD8C");function Xi(e){if(!(e==null||e==="")){if(typeof e=="string"&&/^\s*\d[\d,]*\s*$/.test(e)){const t=Number(e.replace(/[,\s]/g,""));if(Number.isFinite(t))return ia(`${t.toLocaleString("ko-KR")}\uC6D0`)}return ia(typeof e=="number"?`${e.toLocaleString("ko-KR")}\uC6D0`:e)}}function Yy(e){const t=`${e.code??""} ${e.name??""}`.toLowerCase();return/manager|매니저/.test(t)?"manager":"speechear"}function Zy(e){if(e.durationDays&&e.durationDays>0){const s=e.durationDays;return s%365===0?`${s/365}\uB144`:`${s}\uC77C`}const t=(e.code??"").match(/(\d+)(d|y)\b/i);if(t)return t[2].toLowerCase()==="y"?`${t[1]}\uB144`:`${t[1]}\uC77C`;const a=e.name??"",r=a.match(/(\d+\s*(?:년|개월|주|일))\s*(?:이용권)?\s*$/);if(r)return r[1].replace(/\s+/g,"");const l=a.match(/(\d+)\s*-?\s*(day|year)s?\b/i);return l?l[2].toLowerCase()==="year"?`${l[1]}\uB144`:`${l[1]}\uC77C`:a||Ky()}function Xy(e){const t=(e??"").match(/(\d+)(d|y)\b/i);if(!t)return null;const a=Number(t[1]);return t[2].toLowerCase()==="y"?a*365:a}function Ji(e){return{type:e.type??Yy(e),plan:Zy(e),label:e.label,price:Xi(e.price),originalPrice:Xi(e.originalPrice),discountLabel:e.discountLabel}}var Jy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEar_ko_mono" xmlns="http://www.w3.org/2000/svg" width="583.33" height="240" viewBox="0 0 583.33 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Qy='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_SpeechEarManager_ko_mono" xmlns="http://www.w3.org/2000/svg" width="1035.43" height="240" viewBox="0 0 1035.43 240"><g id="text"><path d="M278.07,115.18V47.71h85.73v67.47h-85.73ZM408.4,173.42v20.18h-125.33v-44.02h96.5v-5.96h-96.88v-20.18h124.18v44.02h-96.11v5.96h97.65ZM305.56,70.97v20.76h30.95v-20.76h-30.95ZM423.39,92.88h-16.53v25.37h-27.68V45.98h27.68v20.18h16.53v26.72Z" fill="%23fff"/><path d="M527.58,113.83v26.33c-7.82,3.59-20.06,5.38-36.71,5.38h-1.73v48.06h-27.68v-48.06h-34.21v-26.33h64.01c16.4,0,28.51-1.79,36.33-5.38ZM435.31,75.77v-26.33h80.35v62.09h-27.68v-35.75h-52.67ZM563.33,193.61h-27.68V45.98h27.68v147.63Z" fill="%23fff"/><path d="M644.64,52.32v131.48h-58.24V52.32h58.24ZM634.45,173.81V62.32h-38.25v111.49h38.25ZM713.65,193.61h-10.19v-75.16h-28.64v72.66h-10V46.94h10v61.32h28.64v-62.28h10.19v147.63Z" fill="%23fff"/><path d="M819.46,171.6c6.6-1.35,12.08-3.11,16.44-5.29v10.19c-4.23,2.31-9.64,4.1-16.24,5.38-6.6,1.28-13.3,1.92-20.09,1.92h-57.28V51.36h10.57v122.25h46.71c6.66,0,13.29-.67,19.89-2.02ZM851.47,193.8V45.98h10.57v147.63l-10.57.19Z" fill="%23fff"/><path d="M935.66,113.64l48.44,62.28-8.27,6.34-43.06-56.13c-4.36,16.66-10.38,29.92-18.07,39.79-7.69,9.87-16.72,15.83-27.1,17.88v-10.76c8.71-2.05,16.21-8.07,22.49-18.07,6.28-10,11.05-22.97,14.32-38.92,3.27-15.95,5.03-33.86,5.29-53.73h-39.21v-10h88.61v10h-39.02c-.13,18.84-1.6,35.95-4.42,51.32ZM1015.43,193.61h-10.38v-79.39h-37.87v-10.19h37.87v-58.05h10.38v147.63Z" fill="%23fff"/></g><g id="symbol"><g opacity=".5"><path d="M80,50c-16.57,0-30,13.43-30,30v80c0,8.66,2.21,16.81,6.08,23.92,7.1,3.88,15.25,6.08,23.92,6.08h80c16.57,0,30-13.43,30-30v-80c0-8.66-2.21-16.81-6.08-23.92-7.1-3.88-15.25-6.08-23.92-6.08h-80Z" fill="%23fff"/></g><path d="M140,30h-60c-27.61,0-50,22.39-50,50v23.38l-19.22,21.15c-1.15,1.26-1.02,3.24.3,4.33,5.82,4.84,12.22,8.56,18.92,11.21.03,18.92,10.56,35.37,26.08,43.84-3.88-7.1-6.08-15.25-6.08-23.92v-80c0-16.57,13.43-30,30-30h80c8.66,0,16.81,2.21,23.92,6.08-8.48-15.54-24.97-26.08-43.92-26.08Z" fill="%23fff"/><path d="M183.92,56.08c3.88,7.1,6.08,15.25,6.08,23.92v80c0,16.57-13.43,30-30,30h-80c-8.66,0-16.81-2.21-23.92-6.08,8.48,15.54,24.97,26.08,43.92,26.08h45.11c2.7,0,4.89,2.19,4.89,4.89,0,2.86,2.45,5.13,5.3,4.88,30.65-2.68,54.7-28.42,54.7-59.77v-60c0-18.95-10.54-35.44-26.08-43.92Z" fill="%23fff"/><rect x="69" y="88" width="12" height="24" rx="6" ry="6" fill="%23fff"/><path d="M111,140c-2.92,0-5.85-.75-8.5-2.28-2.39-1.38-3.21-4.44-1.82-6.83,1.38-2.39,4.44-3.21,6.83-1.82,2.74,1.58,6.21,1.13,8.44-1.1,1.08-1.08,1.76-2.45,1.97-3.95.9-6.37,3.71-12.42,8.14-17.5,2.64-3.02,4.03-6.9,3.93-10.92-.21-8.21-6.78-15.05-14.97-15.56-2.76-.18-5.42.33-7.88,1.51-2.49,1.19-5.48.12-6.66-2.37-1.19-2.49-.12-5.48,2.37-6.66,3.96-1.88,8.38-2.73,12.8-2.46,13.32.83,24.01,11.94,24.34,25.29.16,6.53-2.11,12.83-6.39,17.75-3.15,3.61-5.15,7.87-5.77,12.32-.52,3.67-2.18,7-4.8,9.63-3.27,3.27-7.62,4.97-12.02,4.97Z" fill="%23fff"/></g></svg>',Qi='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB_mono" xmlns="http://www.w3.org/2000/svg" width="240" height="240" viewBox="0 0 240 240"><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="%23fff"/></svg>';const Zn={text:"--pass-card-text",sub:"--pass-card-sub",copyright:"--pass-card-copyright"},To=new WeakMap;function e2(e){if(e)return To.get(e)}function kn(e,t){e&&(e.style.setProperty(Zn.text,t.text),e.style.setProperty(Zn.sub,t.sub),t.copyrightColor&&e.style.setProperty(Zn.copyright,t.copyrightColor),To.set(e,t))}function An(e){e&&(e.style.removeProperty(Zn.text),e.style.removeProperty(Zn.sub),e.style.removeProperty(Zn.copyright),To.delete(e))}const eu={text:"var(--color-pureBlack)",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function tu(e={}){const t=Nt(eu,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-two-circle","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-two-circle__c1"}),n.jsx("div",{className:"pass-card-bg-two-circle__c3"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-two-circle__symbol",style:{"--symbol-url":`url("${Qi}")`}})]})}const nu="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71Z",pa=240;var za='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Symbol_IHAB" xmlns="http://www.w3.org/2000/svg" width="240" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 240 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/></svg>';const t2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"},n2=100,a2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function au(e={}){const t=Nt(t2,kn,An),a="var(--color-main)",r=270,l=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:a2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*n2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const r2={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",logoColor:"_mono",copyrightColor:"#ffffff"},o2=100,s2=[{scale:1,opacity:.55},{scale:2,opacity:.4},{scale:3.1,opacity:.28},{scale:4.5,opacity:.18},{scale:6,opacity:.1}];function l2(e={}){const t=Nt(r2,kn,An),a="#ffffff",r=270,l=170;return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-sound-move-v1","aria-hidden":"true",children:[n.jsx("svg",{className:"pass-card-bg-sound-move-v1__svg",viewBox:"0 0 300 189",preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",children:s2.map(({scale:s,opacity:i},u)=>n.jsx("g",{transform:`translate(${r} ${l}) scale(${s*o2/pa}) translate(${-pa/2} ${-pa/2})`,opacity:i,children:n.jsx("path",{d:nu,fill:"none",stroke:a,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"})},u))}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-move-v1__symbol",style:{"--symbol-url":`url("${Qi}")`}})]})}const i2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function u2(e={}){const t=Nt(i2,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk__shape pass-card-bg-talk__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const c2={Logo_SpeechEar_ko:{"":cr,_mono:Jy},Logo_SpeechEarManager_ko:{"":jo,_mono:Qy}};function d2(e,t){if(e)return c2[e]?.[t??""]??void 0}const p2={speechear:cr,manager:jo},m2={speechear:"Logo_SpeechEar_ko",manager:"Logo_SpeechEarManager_ko"},ru=10;function h2(e){return e<=0?0:e>=86400?Math.floor(e/86400)*86400:e>=3600?Math.floor(e/3600)*3600:e>=60?Math.floor(e/60)*60:Math.floor(e)}function ou(e,t){if(e<=0)return t("passCard.remainingSecond",{n:0});const a=Math.floor(e/86400);if(a>0)return t("passCard.remainingDay",{n:a});const r=Math.floor(e/3600);if(r>0)return t("passCard.remainingHour",{n:r});const l=Math.floor(e/60);return l>0?t("passCard.remainingMinute",{n:l}):t("passCard.remainingSecond",{n:Math.floor(e)})}function f2(e,t,a){if(e==="manager"){const r=/년/.test(t)||/yr|year/i.test(t)||/1년|365/.test(t),l=a==="\uC624\uD508\uD2B9\uAC00"||a===Rt.t("passCard.specialLabel");return r?n.jsx(u2,{}):l?n.jsx(l2,{}):n.jsx(au,{})}return n.jsx(tu,{})}function su({ariaLabel:e,product:t,showPrice:a=!1,plan:r,type:l,endDate:s,remainingSeconds:i,endInclusive:u=!1,state:c="active",bg:d,bgOnly:m=!1,textColor:p,subColor:f,copyrightColor:b,logoSrc:x,label:C,price:h,originalPrice:_,discountLabel:g,onUse:A,onRefund:y,onDelete:w}){const{t:v}=xe.useTranslation(),B=t?Ji(t):void 0,k=l??B?.type??"speechear",E=r??B?.plan??v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),D=C??B?.label,N=h??(a?B?.price:void 0),I=_??(a?B?.originalPrice:void 0),P=g??B?.discountLabel,K=o.useMemo(()=>{if(N)return null;const q=t?.durationDays??Xy(t?.code);if(!q||q<=0)return i!=null?{percent:null,remainingLabel:ou(i,v)}:null;const G=q*86400;let de;if(i!=null)de=i;else if((c==="active"||c==="expired")&&s){const me=new Date(s).getTime();if(Number.isNaN(me))return null;const se=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(s)),Ce=/^(\d{4})-(\d{2})-(\d{2})/.exec(La()),ge=Math.round(se&&Ce?(Date.UTC(+se[1],+se[2]-1,+se[3])-Date.UTC(+Ce[1],+Ce[2]-1,+Ce[3]))/864e5:(me-Date.now())/864e5);de=Math.max(0,u?ge+1:ge)*86400}else c==="expired"?de=0:de=G;const Ee=h2(de),ye=Math.max(0,Math.min(100,Math.floor(Math.min(Ee,G)/G*100)));return c==="pending"&&ye>=100?null:{percent:ye,remainingLabel:c==="expired"?v("passCard.expired","\uB9CC\uB8CC\uB428"):ou(de,v)}},[N,c,s,i,u,t?.durationDays,t?.code,v]),T=o.useRef(null),[M,L]=o.useState({}),[Q,H]=o.useState(null),O=!!(A||y||w),U=o.useRef(!1),$=o.useRef(void 0),[V,z]=o.useState(x);o.useLayoutEffect(()=>{z(x)},[x]),o.useLayoutEffect(()=>{const q=T.current;q&&(p!==void 0&&q.style.setProperty("--pass-card-text",p),f!==void 0&&q.style.setProperty("--pass-card-sub",f),b!==void 0&&q.style.setProperty("--pass-card-copyright",b))},[p,f,b]),o.useLayoutEffect(()=>{const q=T.current;if(!q)return;const G=e2(q);if(!x){const de=m2[k],Ee=c==="expired"?"_mono":G?.logoColor??"",ye=d2(de,Ee);z(ye)}},[d,x,k,c]);const Y=q=>{const G=T.current;if(!G)return null;const{left:de,top:Ee,width:ye,height:me}=G.getBoundingClientRect(),se=(q.clientX-de)/ye-.5;return{rotateX:-((q.clientY-Ee)/me-.5)*ru,rotateY:se*ru}},S=(q,G)=>{const de=G*-.7,Ee=q*.7+10,ye=20+(Math.abs(q)+Math.abs(G))*.4;return`${de}px ${Ee}px ${ye}px rgba(0, 0, 0, 0.18)`},R=o.useCallback(q=>{if(da())return;U.current=!0,clearTimeout($.current),$.current=setTimeout(()=>{U.current=!1},200);const G=Y(q);G&&L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.rotateY),transition:"transform 0.25s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.25s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),F=o.useCallback(q=>{if(da())return;const G=Y(q);if(!G)return;const de=U.current?"transform 0.2s ease, box-shadow 0.2s ease":"none";L({transform:`perspective(800px) rotateX(${G.rotateX}deg) rotateY(${G.rotateY}deg) scale3d(1.03, 1.03, 1.03)`,boxShadow:S(G.rotateX,G.rotateY),transition:de})},[]),Z=o.useCallback(()=>{clearTimeout($.current),U.current=!1,L({transform:"perspective(800px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)",boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.08)",transition:"transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1)"})},[]),pe=o.useCallback(()=>H(null),[]),re=o.useMemo(()=>{const q=v("passCard.planSuffix","\uC774\uC6A9\uAD8C"),G=E.replace("\uC774\uC6A9\uAD8C","").replace(q==="\uC774\uC6A9\uAD8C"?"":q,"").trim(),de=G.match(/^(.*?)(일|년)$/);return de?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"h0 pass-card__plan-number",children:de[1]}),n.jsx("span",{className:"h5b pass-card__plan-unit",children:de[2]==="\uB144"?v("passCard.unitYear","\uB144"):v("passCard.unitDay","\uC77C")})]}):n.jsx("span",{className:"h0",children:G})},[E,v]),oe=o.useMemo(()=>{const q=ia(N);if(!q)return null;const G=q.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!G)return n.jsx("span",{className:"h1",children:q});const[,de,Ee,ye]=G;return n.jsxs(n.Fragment,{children:[de&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:de}),n.jsx("span",{className:"h1 pass-card__price-amount",children:Ee}),ye.trim()&&n.jsx("span",{className:"h5 pass-card__price-symbol",children:ye.trim()})]})},[N]),ne=o.useCallback(()=>{O&&H(q=>{if(q)return null;const G=T.current?.getBoundingClientRect();if(!G)return null;const de=50;return{left:G.left,right:G.right,width:G.width,height:G.height,x:G.x,y:G.y+de,top:G.top+de,bottom:G.bottom+de}})},[O]),W=o.useCallback(q=>{O&&(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),ne())},[O,ne]),ie=[{items:[...A?[{label:v("passCard.menu.use","\uC0AC\uC6A9\uD558\uAE30"),icon:"play",onClick:()=>{A(),H(null)},closeOnSelect:!0}]:[],...y?[{label:v("passCard.menu.refund","\uD658\uBD88\uD558\uAE30"),icon:"rotate-ccw",onClick:()=>{y(),H(null)},closeOnSelect:!0}]:[],...w?[{label:v("passCard.menu.delete","\uC0AD\uC81C\uD558\uAE30"),icon:"trash-2",onClick:()=>{w(),H(null)},closeOnSelect:!0}]:[]]}];return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card-frame",children:n.jsxs("div",{ref:T,className:`pass-card pass-card--${c}${O?" pass-card--clickable":""}`,style:M,onMouseEnter:R,onMouseMove:F,onMouseLeave:Z,onPointerUp:q=>{q.pointerType==="touch"&&Z()},onPointerCancel:q=>{q.pointerType==="touch"&&Z()},onClick:ne,onKeyDown:O?W:void 0,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-label":e,"aria-haspopup":O?"menu":void 0,"aria-expanded":O?!!Q:void 0,children:[d??f2(k,E,D),!m&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pass-card__top",children:n.jsxs("div",{className:"pass-card__top-left",children:[n.jsx("img",{src:V??p2[k],className:"pass-card__logo",alt:k==="manager"?v("header.logoManager","\uB9D0\uADC0\uB9E4\uB2C8\uC800 \uB85C\uACE0"):v("header.logoMalgwi","\uB9D0\uADC0 \uB85C\uACE0")}),n.jsxs("div",{className:"pass-card__plan",children:[n.jsx("div",{children:re}),n.jsx("span",{className:"h5b pass-card__plan-suffix",children:D?v("passCard.labeledPlan",{label:D}):v("passCard.planSuffix","\uC774\uC6A9\uAD8C")})]})]})}),N?n.jsxs("div",{className:"pass-card__price-area",children:[P&&n.jsx("span",{className:"pass-card__discount body-3",children:P}),n.jsxs("div",{className:"pass-card__price",children:[I&&n.jsx("span",{className:"pass-card__price-original body-3",children:ia(I)}),oe]})]}):K?n.jsxs("div",{className:"pass-card__usage",children:[n.jsx("span",{className:"h5b pass-card__usage-remaining",children:K.remainingLabel}),K.percent!=null&&n.jsxs("span",{className:"pass-card__usage-percent",children:[n.jsx("span",{className:"h1 pass-card__usage-value",children:K.percent}),n.jsx("span",{className:"h5b pass-card__usage-symbol",children:"%"})]})]}):n.jsx("div",{className:"pass-card__copyright caption-2","aria-hidden":"true",children:"\xA9 IHAB Corp. All rights reserved."})]})]})}),Q&&n.jsx(hn,{anchorRect:Q,onClose:pe,ariaLabel:v("tooltip.menu","\uBA54\uB274"),children:n.jsx(Oa,{columns:ie,onClose:pe,size:"small"})})]})}const C2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#1a1a1a"};function g2(e={}){const t=`passcard-sound-line-grad-${o.useId()}`,a=Nt(C2,kn,An);return n.jsxs("div",{ref:a,className:"pass-card-bg pass-card-bg-sound-line","aria-hidden":"true",children:[n.jsxs("svg",{className:"pass-card-bg-sound-line__svg",viewBox:"0 0 500 300",preserveAspectRatio:"xMidYMid slice",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:t,x1:"0",y1:"0",x2:"1",y2:"0",children:[n.jsx("stop",{offset:"20%",stopColor:"var(--color-main)"}),n.jsx("stop",{offset:"80%",stopColor:"var(--color-sub)"})]})}),n.jsx("g",{transform:"translate(25, 45)",children:n.jsx("path",{d:"M -30 150 C 40 80, 100 220, 160 150 S 280 80, 340 150 S 460 220, 510 150",fill:"none",stroke:`url(#${t})`,strokeWidth:"50",strokeLinecap:"round"})})]}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-sound-line__symbol",style:{"--symbol-url":`url("${za}")`}})]})}const b2={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"var(--color-main)"};function y2(e={}){const t=Nt(b2,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-talk-v1","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--left"}),n.jsx("div",{className:"pass-card-bg-talk-v1__shape pass-card-bg-talk-v1__shape--right"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-talk-v1__symbol",style:{"--symbol-url":`url("${za}")`}})]})}function v2(e,t){if(e){if(t==="manager_pro")return n.jsx(y2,{});if(t==="manager_standard")return n.jsx(g2,{});if(t==="manager_lite")return n.jsx(au,{})}}function x2(e){const t=ia(e);if(!t)return null;const a=t.match(/^([^\d]*)([\d.,]+)(.*)$/);if(!a)return t;const[,r,l,s]=a;return n.jsxs(n.Fragment,{children:[r&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:r}),l,s.trim()&&n.jsx("span",{className:"payment-plan__pricing-symbol h4",children:s.trim()})]})}function _2(e){const{t}=xe.useTranslation(),a=t("payment.plan.tierFallback",{defaultValue:"\uC774\uC6A9\uAD8C"}),r=t("payment.plan.openPromo",{defaultValue:"\uC624\uD508 \uD2B9\uAC00"}),{plan:l,onSelect:s,period:i="monthly",ownedCodes:u}=e||{},c=y=>!!y&&!!u?.includes(y),d=y=>y.onceOnly??/오픈\s*특가/.test(y.label??""),m=(l.tiers||[]).some(y=>d(y)&&c(y.code)),p=y=>{const w=y.prices?y.prices[i]:y.price;return w?(l.tiers||[]).some(v=>!!v.badge&&v.originals?.[i]===w):!1},f=l.colorToken?`var(--color-${l.colorToken})`:"var(--color-gray)",b=t("payment.plan.freePrice","\uBB34\uB8CC"),x=t("payment.products.mgrEnterprise.tier.price","\uBB38\uC758"),C=y=>y.prices?y.prices[i]:y.price,h=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB34\uB8CC"||w===b||w==="0\uC6D0"||typeof w=="string"&&/\d/.test(w)&&!/[1-9]/.test(w)}),_=(l.tiers||[]).length>0&&(l.tiers||[]).every(y=>{const w=C(y);return w==="\uBB38\uC758"||w===x}),g=l.group==="org",A=g?"manager":"speechear";return n.jsxs("div",{className:"payment-plan__card",style:{borderColor:f,"--plan-color":f},children:[l.cardBadge&&n.jsx("div",{className:"payment-plan__card-badge",children:n.jsx(Et,{label:l.cardBadge,variant:"main",size:"medium",fill:"soft"})}),n.jsxs("div",{className:"payment-plan__title",children:[n.jsx("p",{className:"payment-plan__quote body-3b",style:{color:f},children:l.quote||"\xA0"}),n.jsx("h3",{className:"payment-plan__title-heading h1",children:l.tier??l.title}),n.jsx("p",{className:"payment-plan__subtitle body-3",children:l.subtitle})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.recommendedFor","\uC774\uB7F0 \uBD84\uAED8 \uCD94\uCC9C\uD569\uB2C8\uB2E4.")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(l.recommendedFor||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsxs("div",{className:"payment-plan__box",children:[n.jsx("span",{className:"payment-plan__box-title body-3b",children:t("payment.plan.features","\uD575\uC2EC \uAE30\uB2A5")}),n.jsx("ul",{className:"payment-plan__feature-list",children:(l.features||[]).map((y,w)=>n.jsxs("li",{className:"payment-plan__feature-item body-3",children:[n.jsx(Qe,{icon:"check",size:18,className:"payment-plan__feature-check",wrapperStyle:{color:f}}),y]},w))})]}),n.jsx("div",{className:"payment-plan__card-pricing",children:h?null:_?n.jsx(fe,{htmlType:"button",className:"payment-plan__contact-button",label:t("payment.plan.contact",{defaultValue:"\uBB38\uC758\uD558\uAE30"}),variant:"main",size:56,onClick:()=>l.tiers?.[0]&&s?.({...l.tiers[0],productId:l.id,productTitle:l.title})}):n.jsx(n.Fragment,{children:n.jsx("div",{className:"payment-plan__pricing-list",children:(l.tiers||[]).map(y=>{const w=y.label||a,v=d(y),B=v||y.openPromo===!0,k=w.replace(/^오픈\s*특가\s*/,"")||a,E=y.prices?y.prices[i]:y.price,D=y.badge?B?`${r}
823
823
  ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!m)return p(y)?null:n.jsxs("div",{className:`payment-plan__pricing-row payment-plan__pricing-row--static${y.highlight?" payment-plan__pricing-row--highlight":""}`,children:[n.jsx("div",{className:"payment-plan__pricing-row-title",children:n.jsx("div",{className:"payment-plan__pricing-row-label h5b",children:y.label})}),n.jsx("div",{className:"payment-plan__pricing-row-price",children:n.jsx("span",{className:"payment-plan__pricing-current h1",children:x2(E)})})]},y.id);const N=l.tier??(g?l.title:void 0),I=n.jsx(su,{showPrice:!0,product:{type:A,code:y.code,name:k,label:N,price:E,originalPrice:y.originals?.[i]??void 0,discountLabel:D},bg:v2(g,l.id)}),P=()=>s?.({...y,productId:l.id,productTitle:l.title,preview:I});return n.jsx("div",{className:"payment-plan__pricing-card",onClick:P,onKeyDown:s?K=>{K.target===K.currentTarget&&(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),P())}:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,children:I},y.id)})})})})]})}function w2({variant:e="default"}){return n.jsxs("div",{className:`pass-card-bg pass-card-bg--${e}`,"aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--1"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--2"}),n.jsx("div",{className:"pass-card-bg__circle pass-card-bg__circle--3"})]})}var Mo='data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?><svg id="Logo_IHAB_en" xmlns="http://www.w3.org/2000/svg" width="765.08" height="240" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 765.08 240"><defs><linearGradient id="linear-gradient" x1="62.99" y1="62.99" x2="190.71" y2="190.71" gradientUnits="userSpaceOnUse"><stop offset=".2" stop-color="%23499cdf"/><stop offset=".8" stop-color="%234dcdc0"/></linearGradient></defs><path id="symbol" d="M190.71,49.29c-18.1-18.1-43.1-29.29-70.71-29.29s-34.94,28.87-53.03,46.97h0c-18.1,18.1-46.97,25.56-46.97,53.03s11.19,52.61,29.29,70.71c18.1,18.1,43.1,29.29,70.71,29.29s52.61-11.19,70.71-29.29c18.1-18.1,29.29-43.1,29.29-70.71s-11.19-52.61-29.29-70.71ZM155.36,155.36c-9.05,9.05-21.55,14.64-35.36,14.64s-26.31-5.6-35.36-14.64c-9.05-9.05-14.64-21.55-14.64-35.36s5.6-26.31,14.64-35.36c9.05-9.05,21.55-14.64,35.36-14.64s26.31,5.6,35.36,14.64c9.05,9.05,14.64,21.55,14.64,35.36s-5.6,26.31-14.64,35.36Z" fill="url(%23linear-gradient)"/><g id="text"><path d="M316.21,190.6h-36.74V50.61h36.74v139.99Z"/><path d="M335.16,50.61h36.74v55.11h51.63v-55.11h36.93v139.99h-36.93v-55.11h-51.63v55.11h-36.74V50.61Z"/><path d="M473.99,190.6l46.6-139.99h50.08l46.41,139.99h-39.64l-8.31-27.46h-46.99l-8.31,27.46h-39.83ZM560.62,135.3l-14.5-46.99h-1.16l-14.31,46.99h29.97Z"/><path d="M631,50.61h59.94c31.9,0,48.73,13.73,48.73,35.19,0,15.47-11.02,27.26-26.88,30.55v1.35c17.6.58,32.29,13.54,32.29,33.45,0,22.82-18.56,39.45-49.11,39.45h-64.97V50.61ZM701.77,93.53c0-8.89-6.96-13.92-17.02-13.92h-17.02v27.84h16.44c10.25,0,17.6-5.03,17.6-13.92ZM706.22,146.51c0-10.25-7.35-16.05-19.14-16.05h-19.34v30.55h18.76c13.15,0,19.72-5.03,19.72-14.5Z"/></g></svg>';const lu={text:"#1a1a1a",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEar_ko",copyrightColor:"#c9c9c9"};function B2(){const e=Nt(lu,kn,An);return n.jsx("div",{ref:e,className:"pass-card-bg pass-card-bg-ihab","aria-hidden":"true",children:n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-ihab__symbol-top",style:{"--symbol-url":`url("${Mo}")`}})})}const iu={text:"#ffffff",sub:"var(--color-lightGray)",logoBase:"Logo_SpeechEarManager_ko",logoColor:"_mono",copyrightColor:"#ffffff"};function k2(e={}){const t=Nt(iu,kn,An);return n.jsxs("div",{ref:t,className:"pass-card-bg pass-card-bg-left-color-grid","aria-hidden":"true",children:[n.jsx("div",{className:"pass-card-bg-left-color-grid__bar"}),n.jsx("div",{className:"pass-card-bg-left-color-grid__grid"}),n.jsx("span",{className:"pass-card-bg__symbol pass-card-bg-left-color-grid__symbol",style:{"--symbol-url":`url("${za}")`}})]})}function uu({keys:e,anchor:t="top-right",scale:a,className:r=""}){const l=Array.isArray(e)?e:[e];return n.jsx("span",{className:_e("shortcut-badge",`shortcut-badge--${t}`,r),style:a===void 0?void 0:{"--shortcut-badge-scale":String(a)},children:l.map((s,i)=>n.jsxs("span",{className:"shortcut-badge__group",children:[i>0&&n.jsx("span",{className:"shortcut-badge__plus",children:"+"}),n.jsx("kbd",{className:"shortcut-badge__key",children:s})]},`${s}-${i}`))})}const Wa=(e,t,a)=>e+(t-e)*a;function A2({speakers:e,size:t=300,viewT:a=0,activeSpeakerId:r=null,playedIds:l,selectedId:s=null,answerId:i=null,showFeedback:u=!1,pulseSelected:c=!1,pulseSelectedDuration:d,pulseScale:m,clickable:p=!1,onSelectSpeaker:f,buttonSize:b=40,showIcon:x=!0,onCenterClick:C,centerLabel:h,centerDisabled:_=!1,centerAttention:g=!1,shortcutAnchor:A="top-right",shortcutScale:y,scaleShortcut:w=!1}){const{t:v}=xe.useTranslation(),B=Math.max(0,Math.min(1,a)),k=t/2,E=110/300,D=.18,N=q=>t*(E+(q-1)*D),I=q=>{const G=N(q.row??1),de=q.angleDeg*Math.PI/180;return{x:k+G*Math.cos(de),y:k+G*Math.sin(de)}},P=Math.max(...e.map(q=>q.row??1),1),K=t*.08,T=t*.1,M=t*.24,L=t-2*K,Q=t-T-M,H=t-M/2,O=o.useMemo(()=>[...new Set(e.map(q=>q.deg))].sort((q,G)=>q-G),[e]),U=O.length,$=Math.max(68,U>1?L/(U-1):0),V=o.useMemo(()=>new Map(O.map((q,G)=>[q,G])),[O]),z=q=>{const G=V.get(q.deg)??0,de=k+(G-(U-1)/2)*$,Ee=P>1?Math.min(68,Q/(P-1)):0,ye=Ee*(P-1),me=T+(Q-ye)/2,se=P===1?T+Q*.4:me+(P-(q.row??1))*Ee;return{x:de,y:se}},Y=q=>{const G=I(q),de=z(q);return{x:Wa(G.x,de.x,B),y:Wa(G.y,de.y,B)}},S={x:k,y:Wa(k,H,B)},R=Math.round(b*1.2),F=Math.round(Math.max(16,Math.min(80,b*.7))),Z=[],pe=new Map;for(const q of e){const G=q.row??1;pe.has(G)||pe.set(G,[]),pe.get(G).push(q)}for(const[q,G]of pe.entries()){if(G.length<2)continue;const de=[...G].sort((We,dt)=>We.deg-dt.deg),Ee=de.map(We=>Y(We)),ye=de.map(We=>We.deg),me=ye[ye.length-1]-ye[0],se=me/(ye.length-1),Ce=360-me,ge=de.length>=3&&se>0&&Ce<=se*1.5,ce=Math.round(N(q)*1e3)/1e3,Me=(We,dt,lt,at)=>{const mt=(dt.angleDeg-We.angleDeg+540)%360-180;if(mt===0)return`L ${at.x} ${at.y}`;if(B===0)return`A ${ce} ${ce} 0 0 ${mt>0?1:0} ${at.x} ${at.y}`;const Ae=(We.angleDeg+mt/2)*Math.PI/180,qe={x:k+ce*Math.cos(Ae),y:k+ce*Math.sin(Ae)},we={x:(lt.x+at.x)/2,y:(lt.y+at.y)/2},Ue={x:Wa(qe.x,we.x,B),y:Wa(qe.y,we.y,B)},ke={x:2*Ue.x-we.x,y:2*Ue.y-we.y};return`Q ${ke.x} ${ke.y} ${at.x} ${at.y}`},Oe=ge?[...de,de[0]]:de,Le=ge?[...Ee,Ee[0]]:Ee;let ze=`M ${Le[0].x} ${Le[0].y}`;for(let We=1;We<Le.length;We++)ze+=" "+Me(Oe[We-1],Oe[We],Le[We-1],Le[We]);Z.push({key:`arc-${q}`,d:ze})}const re=o.useMemo(()=>new Set(l??[]),[l]),oe=q=>({idle:"",active:v("soundCompass.state.active","\uC18C\uB9AC \uB098\uB294 \uC911"),played:v("soundCompass.state.played","\uB4E4\uC74C"),correct:v("soundCompass.state.correct","\uC815\uB2F5"),wrong:v("soundCompass.state.wrong","\uC624\uB2F5")})[q],ne=q=>{if(r===q.id)return"active";if(u){if(q.id===i)return"correct";if(q.id===s&&s!==i)return"wrong"}return re.has(q.id)?"played":"idle"},W=q=>r===q.id?"loop":u?q.id===i?"loop":null:c&&q.id===s?"once":null,ie=(q,G)=>{switch(q){case"played":case"correct":return n.jsx(Rs,{size:G});case"wrong":return n.jsx(Us,{size:G});default:return n.jsx(qs,{size:G})}};return n.jsx("div",{className:"sound-compass",children:n.jsxs("div",{className:"sound-compass__compass-wrap",style:{width:t,height:t},children:[n.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,className:"sound-compass__svg",children:[B===0&&e.map(q=>{const{x:G,y:de}=Y(q);return n.jsx("line",{x1:S.x,y1:S.y,x2:G,y2:de,stroke:"#dde3ec",strokeWidth:"1"},q.id)}),Z.map(q=>n.jsx("path",{d:q.d,fill:"none",stroke:"#dde3ec",strokeWidth:"1"},q.key))]}),g&&!_&&n.jsx("div",{className:"sound-compass__pulse sound-compass__pulse--active sound-compass__pulse--center",style:{width:R,height:R,left:S.x-R/2,top:S.y-R/2}}),C?n.jsx("button",{type:"button",className:`sound-compass__center sound-compass__center--button${_?" sound-compass__center--disabled":""}`,style:{width:R,height:R,left:S.x,top:S.y},"aria-label":h,"aria-disabled":_||void 0,tabIndex:_?-1:0,onClick:_?void 0:C,children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}):n.jsx("div",{className:"sound-compass__center",style:{width:R,height:R,left:S.x,top:S.y},children:n.jsx(Pr,{size:F,color:"currentColor",strokeWidth:1.5})}),e.map((q,G)=>{const{x:de,y:Ee}=Y(q),ye=ne(q),me=W(q),se={...y!==void 0||w?{"--shortcut-badge-scale":String(y??Math.max(.75,Math.min(3,b/56)))}:null,pointerEvents:p?"auto":"none",cursor:p?"pointer":"default",zIndex:ye!=="idle"?10:1},Ce=b,ge=Math.round(Math.max(10,Math.min(56,Ce*.38))),ce=Math.round(Math.max(7,Math.min(18,Ce*.2))),Me=Math.round(Math.max(10,Math.min(56,Ce*.4))),Oe=x==="answered"&&(ye==="played"||ye==="correct"||ye==="wrong"),Le=x===!0||Oe,ze=!Oe;return n.jsxs("div",{className:"sound-compass__speaker-pos",style:{...se,left:de-Ce/2,top:Ee-Ce/2},children:[me&&n.jsx("div",{className:`sound-compass__pulse sound-compass__pulse--${ye}`+(me==="once"?" sound-compass__pulse--once":""),style:{width:Ce,height:Ce,...me==="once"&&d!==void 0?{"--sc-pulse-duration-once":`${d}ms`}:null,...m!==void 0?{"--sc-pulse-scale":String(m)}:null}}),n.jsxs("button",{type:"button",tabIndex:p?0:-1,"aria-disabled":p?void 0:!0,onClick:p?()=>f?.(q.id):void 0,className:`sound-compass__speaker-btn sound-compass__speaker-btn--${ye}`,style:{width:Ce,height:Ce},"aria-label":oe(ye)?`${q.label}, ${oe(ye)}`:q.label,"aria-pressed":s!=null?q.id===s:void 0,children:[Le&&ie(ye,ge),ze&&n.jsx("span",{className:"sound-compass__speaker-number",style:{fontSize:x===!0?ce:Me},children:G+1})]}),q.shortcut&&n.jsx(uu,{keys:q.shortcut,anchor:A,className:"sound-compass__speaker-shortcut"})]},q.id)})]})})}function N2({children:e,position:t="top-left",size:a=24,className:r=""}){return n.jsx("span",{className:_e("circle-badge","circle-badge--number",`circle-badge--${a}`,`circle-badge--${t}`,r),children:e})}function E2({orientation:e="horizontal",label:t,className:a=""}){const r=_e("divider",`divider--${e}`,t&&e==="horizontal"?"divider--labeled":"",a);return e==="vertical"?n.jsx("div",{className:r,role:"separator","aria-orientation":"vertical"}):t?n.jsxs("div",{className:r,role:"separator","aria-orientation":"horizontal",children:[n.jsx("span",{className:"divider__line"}),n.jsx("span",{className:"divider__label caption-1",children:t}),n.jsx("span",{className:"divider__line"})]}):n.jsx("div",{className:r,role:"separator","aria-orientation":"horizontal"})}function cu({checked:e,onChange:t,name:a,value:r,disabled:l=!1,label:s,className:i=""}){const u=o.useId();return n.jsxs("label",{className:`radio${l?" radio--disabled":""} ${i}`.trim(),htmlFor:u,children:[n.jsx("input",{id:u,type:"radio",name:a,value:r,checked:e,disabled:l,onChange:c=>t?.(c.target.checked)}),n.jsx("span",{className:"radio__dot"}),s&&n.jsx("span",{className:"radio__label body-2",children:s})]})}function D2({options:e,value:t,onChange:a,name:r,disabled:l=!1,direction:s="vertical",className:i="",ariaLabel:u}){const c=o.useId(),d=r??`radio-group-${c}`;return n.jsx("div",{className:`radio-group radio-group--${s} ${i}`.trim(),role:"radiogroup","aria-label":u,children:e.map(m=>n.jsx(cu,{name:d,value:m.value,checked:t===m.value,disabled:l||m.disabled,label:m.label,onChange:p=>{p&&a?.(m.value)}},m.value))})}const S2={info:"info",success:"check-circle",warning:"alert-triangle",danger:"alert-circle"};function j2({tone:e="info",title:t,message:a,children:r,dismissible:l=!1,onDismiss:s,live:i,className:u=""}){const{t:c}=xe.useTranslation(),[d,m]=o.useState(!1),p=o.useRef(null),f=o.useCallback(()=>{const g=p.current;g&&g.contains(document.activeElement)&&sr(g),m(!0),s?.()},[s]);if(d)return null;const b=_e("alert",`alert--${e}`,u),x=i??(e==="danger"||e==="warning"?"assertive":"polite"),C=x==="assertive"?"alert":x==="polite"?"status":void 0,h=!!t,_=!!(a||r);return n.jsxs("div",{ref:p,className:b,role:C,children:[n.jsxs("div",{className:"alert__body",children:[n.jsxs("div",{className:"alert__header",children:[n.jsx(Qe,{icon:S2[e],size:20,className:"alert__icon"}),h&&n.jsx("span",{className:"alert__title body-2",children:t}),!h&&_&&n.jsx("div",{className:"alert__message body-3",children:a||r})]}),h&&_&&n.jsx("div",{className:"alert__message alert__message--indented body-3",children:a||r})]}),l&&n.jsx("button",{type:"button",className:"alert__dismiss",onClick:f,"aria-label":c("common.close","\uB2EB\uAE30"),children:"\xD7"})]})}const T2={ready:"search",guide:"info",error:"circle-alert"};function M2(e,t){const a=t.filter(Boolean);if(a.length===0)return e;const r=[];let l=0,s=0;for(const i of a){const u=e.indexOf(i,l);u<0||(u>l&&r.push(e.slice(l,u)),r.push(n.jsx("strong",{className:"search-summary__em body-2",children:i},s++)),l=u+i.length)}return l<e.length&&r.push(e.slice(l)),r}function L2({status:e="guide",label:t,children:a,emphasis:r,icon:l,className:s=""}){const i=l===!1?null:l??T2[e],u=_e("search-summary",`search-summary--${e}`,s),c=t??a,d=typeof c=="string"&&r&&r.length>0?M2(c,r):c;return n.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[i!=null&&n.jsx(Qe,{icon:i,size:18,className:"search-summary__icon"}),n.jsx("span",{className:"search-summary__text body-2",children:d})]})}function Ha({title:e,items:t}){const{t:a}=xe.useTranslation(),{anchorRect:r,openAt:l,close:s}=Pa(),i=o.useRef(null),u=yo(!!r,(c,d)=>{c&&d?l(i.current?.querySelector("button")??d):s()},i);return n.jsxs("span",{ref:i,style:{display:"contents"},children:[n.jsx(fe,{htmlType:"button",size:24,type:"dot",icon:"info",variant:"transparent-gray",useBorder:!1,selected:!!r,ariaLabel:a("common.info","\uC124\uBA85"),onPointerEnter:c=>{ca(c)||l(c.currentTarget)},onPointerLeave:c=>{ca(c)||s()},onClick:c=>{u.touchPress(c.currentTarget)},onFocus:c=>{da()||l(c.currentTarget)},onBlur:s}),r&&n.jsx(Kn,{title:e,items:t,showIndex:t.length>1,anchorRect:r,onClose:s})]})}function $2({items:e=[],value:t,onChange:a,className:r="",size:l=40}){const s=o.useId(),{t:i}=xe.useTranslation(),u=o.useRef(null),c=e.find(C=>!C.disabled)?.key,d=e.some(C=>C.key===t)?t:c??e[0]?.key,m=e.find(C=>C.key===d&&!C.disabled)?.key??c,p=()=>Array.from(u.current?.querySelectorAll('[role="tab"]:not(:disabled)')??[]),f=(C,h=p())=>{if(h.length===0)return;const _=(C%h.length+h.length)%h.length;h[_]?.focus(),h[_]?.click()},b=C=>{if(!["ArrowRight","ArrowDown","ArrowLeft","ArrowUp","Home","End"].includes(C.key))return;C.preventDefault();const h=p(),_=h.indexOf(C.currentTarget);C.key==="ArrowRight"||C.key==="ArrowDown"?f(_+1,h):C.key==="ArrowLeft"||C.key==="ArrowUp"?f(_-1,h):C.key==="Home"?f(0,h):f(h.length-1,h)},x=e.find(C=>C.key===d);return n.jsxs("div",{className:`tabs ${r}`.trim(),children:[n.jsx("div",{ref:u,className:`tabs__list tabs__list--${l}`,role:"tablist","aria-label":i("tabs.ariaLabel","\uD0ED"),children:e.map(C=>n.jsx("button",{id:`tabs__tab-${s}-${C.key}`,type:"button",role:"tab","aria-selected":C.key===d,"aria-controls":`tabs__panel-${s}-${C.key}`,disabled:C.disabled,tabIndex:C.key===m?0:-1,className:`tabs__tab body-2${C.key===d?" tabs__tab--active":""}`,onClick:()=>{C.key!==t&&a?.(C.key)},onKeyDown:b,children:C.label},C.key))}),x&&n.jsx("div",{id:`tabs__panel-${s}-${x.key}`,role:"tabpanel","aria-labelledby":`tabs__tab-${s}-${x.key}`,tabIndex:0,className:"tabs__panel",children:x.panel},x.key)]})}const R2={xs:12,sm:16,md:20,lg:28,xl:36};function P2(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.length===1?[...t[0]].slice(0,2).join("").toUpperCase():([...t[0]][0]+[...t[t.length-1]][0]).toUpperCase()}function I2({src:e,name:t,size:a="md",shape:r="circle",className:l=""}){const{t:s}=xe.useTranslation(),[i,u]=o.useState(null),c=!!e&&i===e,d=t?P2(t):"",m=!!e&&!c,p=!m&&!!d,f=t||s("avatar.ariaLabel","\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0");return n.jsxs("span",{className:`avatar avatar--${a} avatar--${r} ${l}`.trim(),role:"img","aria-label":f,children:[m&&n.jsx("img",{className:"avatar__image",src:e,alt:f,onError:()=>u(e??null)}),!m&&p&&n.jsx("span",{className:"avatar__initials","aria-hidden":"true",children:d}),!m&&!p&&n.jsx(Qe,{icon:"user-round",size:R2[a],className:"avatar__icon"})]})}function F2(e,t){if(!t)return!0;const a=t.split(",").map(s=>s.trim()).filter(Boolean);if(a.length===0)return!0;const r=e.name.toLowerCase(),l=e.type.toLowerCase();return a.some(s=>{const i=s.toLowerCase();return i.startsWith(".")?r.endsWith(i):i.endsWith("/*")?l.startsWith(i.slice(0,-1)):l===i})}function O2({onFilesSelected:e,accept:t,multiple:a=!1,disabled:r=!1,showFileList:l=!0,files:s,onRemove:i,className:u=""}){const{t:c}=xe.useTranslation(),d=o.useRef(null),[m,p]=o.useState(!1),[f,b]=o.useState([]),x=s??f,C=v=>{if(!v||v.length===0)return;const B=Array.from(v).filter(E=>F2(E,t));if(B.length===0)return;const k=a?B:B.slice(0,1);if(s===void 0){const E=a?[...x,...k]:k;b(E),e?.(E)}else e?.(k)},h=v=>{v.preventDefault(),!r&&p(!0)},_=v=>{v.preventDefault(),p(!1)},g=v=>{v.preventDefault(),p(!1),!r&&C(v.dataTransfer.files)},A=v=>{const B=v.target;try{C(B.files)}finally{B.value=""}},y=()=>{r||d.current?.click()},w=v=>{if(!r&&(i?.(v),s===void 0)){const B=x.filter((k,E)=>E!==v);b(B),i||e?.(B)}};return n.jsxs("div",{className:`file-upload ${u}`.trim(),children:[n.jsxs("div",{className:_e("file-upload__dropzone",m&&"file-upload__dropzone--dragging",r&&"file-upload__dropzone--disabled"),role:"button",tabIndex:r?-1:0,"aria-disabled":r,onClick:y,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),y())},onDragOver:h,onDragLeave:_,onDrop:g,children:[n.jsx(Qe,{icon:"upload",size:24,className:"file-upload__icon"}),n.jsx("span",{className:"file-upload__prompt body-2",children:c("fileUpload.dragPrompt","\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC")}),n.jsx("button",{type:"button",className:"file-upload__browse-button body-3",disabled:r,onClick:v=>{v.stopPropagation(),y()},children:c("fileUpload.browseButton","\uD30C\uC77C \uC120\uD0DD")}),n.jsx("input",{ref:d,type:"file",className:"file-upload__input",accept:t,multiple:a,disabled:r,onChange:A,tabIndex:-1})]}),l&&x.length>0&&n.jsx("ul",{className:"file-upload__list",children:x.map((v,B)=>n.jsxs("li",{className:"file-upload__list-item body-3",children:[n.jsx("span",{className:"file-upload__file-name body-3",children:v.name}),n.jsx("button",{type:"button",className:"file-upload__remove-button","aria-label":c("fileUpload.removeAriaLabel",{name:v.name}),disabled:r,onClick:()=>w(B),children:n.jsx(Qe,{icon:"x",size:14})})]},`${v.name}-${B}`))})]})}function z2({items:e,className:t=""}){const{t:a}=xe.useTranslation();return n.jsx("nav",{className:`breadcrumb ${t}`.trim(),"aria-label":a("breadcrumb.ariaLabel","\uC774\uB3D9 \uACBD\uB85C"),children:n.jsx("ol",{className:"breadcrumb__list",children:e.map((r,l)=>{const s=l===e.length-1;return n.jsxs("li",{className:"breadcrumb__item",children:[s?n.jsx("span",{className:"breadcrumb__current body-3","aria-current":"page",children:r.label}):r.href?n.jsx("a",{className:"breadcrumb__link body-3",href:r.href,target:r.target,rel:r.rel??(r.target==="_blank"?"noopener noreferrer":void 0),onClick:r.onClick,children:r.label}):r.onClick?n.jsx("button",{type:"button",className:"breadcrumb__link body-3",onClick:r.onClick,children:r.label}):n.jsx("span",{className:"breadcrumb__text body-3",children:r.label}),!s&&n.jsx(Qe,{icon:"chevron-right",size:14,className:"breadcrumb__separator"})]},l)})})})}const W2={small:14,medium:20,large:28};function H2({value:e,onChange:t,max:a=5,readOnly:r=!1,size:l="medium",ariaLabel:s,className:i=""}){const{t:u}=xe.useTranslation(),c=r||!t,[d,m]=o.useState(null),p=c?e:Number.isFinite(e)?Math.round(e):0,f=d??p,b=W2[l],x=v=>{v!==e&&t?.(v)},C=v=>{c||x(v)},h=v=>{c||da()||m(v)},_=o.useRef(null),g=v=>{const B=Math.min(a,Math.max(1,v));x(B),Array.from(_.current?.querySelectorAll("[data-star]")??[]).find(k=>k.dataset.star===String(B))?.focus()},A=v=>{if(!c){switch(v.key){case"ArrowRight":case"ArrowUp":g((p||0)+1);break;case"ArrowLeft":case"ArrowDown":g((p||1)-1);break;case"Home":g(1);break;case"End":g(a);break;default:return}v.preventDefault()}},y=p>=1&&p<=a?Math.round(p):1,w=()=>{c||m(null)};return n.jsx("div",{className:`rating rating--${l}${c?" rating--readOnly":""} ${i}`.trim(),ref:_,onKeyDown:A,role:c?"img":"radiogroup","aria-label":c?u("rating.valueLabel",{value:e,max:a}):s??u("rating.groupLabel","\uBCC4\uC810"),onMouseLeave:w,onPointerUp:v=>{v.pointerType==="touch"&&w()},onPointerCancel:v=>{v.pointerType==="touch"&&w()},children:Array.from({length:a},(v,B)=>{const k=B+1,E=Math.max(0,Math.min(1,f-B)),D=E>0&&E<1,N=n.jsxs("span",{className:"rating__star-wrap",children:[n.jsx(Qe,{icon:"star",size:b,className:"rating__star rating__star--empty"}),E>0&&n.jsx("span",{className:`rating__star-fill${D?" rating__star-fill--half":""}`,style:D?{width:`${E*100}%`}:void 0,children:n.jsx(Qe,{icon:"star",size:b,className:"rating__star rating__star--filled"})})]});return c?n.jsx("span",{className:"rating__item","aria-hidden":"true",children:N},k):n.jsx("button",{type:"button",className:"rating__item rating__item--interactive",role:"radio","aria-checked":p===k,"aria-label":u("rating.starLabel",{n:k}),"data-star":k,tabIndex:k===y?0:-1,onClick:()=>C(k),onMouseEnter:()=>h(k),children:N},k)})})}const V2=20,q2=["#499cdf","#4dcdc0","#2fae9e","#e6b94e","#d9534f","#e06b68","#bfc7d1"];function U2({value:e,onChange:t,palette:a=q2,size:r=40,className:l="",ariaLabel:s}){const{t:i}=xe.useTranslation();return n.jsx("div",{className:`color-picker ${l}`.trim(),role:"group","aria-label":s,children:a.map(u=>{const c=e?.toLowerCase()===u.toLowerCase();return n.jsx("button",{type:"button",className:`color-picker__swatch color-picker__swatch--${r}`,style:{backgroundColor:u},onClick:()=>t(u),"aria-pressed":c,"aria-label":c?`${u} ${i("colorPicker.selected","\uC120\uD0DD\uB428")}`:u,children:c&&n.jsx(Qe,{icon:"check",size:V2,className:"color-picker__check"})},u)})})}function du({icon:e,label:t,tooltip:a,wrapperStyle:r,color:l,bgColor:s,useHover:i=!0,iconSize:u="medium"}){const{t:c}=xe.useTranslation(),d=u==="small",m=_e("category-icon",d?"category-icon--small":""),p=d?16:20,f=o.useRef(null),[b,x]=o.useState(!1),C=o.useMemo(()=>{const k=r&&typeof r=="object"?{...r}:{};return!l&&!s?k:{...k,...l?{color:l,"--t-item-fg":l}:{},...s?{"--t-item-bg":s}:{}}},[r,l,s]),h=a||t,_=i&&!!h,[g,A]=o.useState(null);o.useLayoutEffect(()=>{b&&A(f.current?.getBoundingClientRect()??null)},[b]),o.useEffect(()=>{if(!i&&b)try{x(!1)}catch{}},[i,b]),o.useEffect(()=>{if(!b)return;const k=E=>{const D=f.current;if(!D)return;const N=E.target;N&&!D.contains(N)&&x(!1)};return document.addEventListener("pointerdown",k,!0),()=>document.removeEventListener("pointerdown",k,!0)},[b]);const y=o.useCallback(()=>{i&&x(!0)},[i]),w=o.useCallback(()=>{i&&x(!1)},[i]),v=o.useCallback(()=>x(!1),[]),B=o.useCallback(k=>{if(k.key==="Escape"){x(!1);return}(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),x(E=>!E))},[]);return n.jsxs("span",{ref:f,className:_e("category-icon__wrap",_&&"category-icon__wrap--interactive"),onPointerEnter:y,onPointerLeave:w,onFocus:y,onBlur:w,onKeyDown:B,role:"button",tabIndex:0,"aria-label":typeof h=="string"?c("common.descriptionFor",{name:h,defaultValue:`${h} \uC124\uBA85`}):void 0,"aria-haspopup":!!h,"aria-expanded":b,"data-tooltip-ignore":!0,children:[n.jsx(Qe,{icon:e,label:t,className:m,imgClassName:"category-icon__image",maskClassName:"category-icon__mask",svgClassName:"category-icon__svg",wrapperStyle:C,size:p}),b&&h&&n.jsx(wn,{anchorRect:g,text:typeof h=="string"?h:void 0,offset:8,onClose:v,className:"category-icon__tooltip",ariaLabel:typeof h=="string"?h:void 0})]})}let Fn=null;function dr(e){if(Fn&&Fn!==e)try{Fn()}catch{}return Fn=e,()=>{Fn===e&&(Fn=null)}}function pr(e){if(Fn===e){Fn=null;try{e()}catch{}}}function mr(e,t){let a=()=>{};const r=new Promise(u=>{a=u});if(typeof e!="string"||e.trim()===""){St("one-shot-empty-url","[core] playOneShot \uC5D0 \uBE48 \uC8FC\uC18C\uAC00 \uC654\uB2E4 \u2014 \uC548 \uD2BC\uB2E4. \uBD80\uB974\uB294 \uCABD\uC774 \uC8FC\uC18C\uB97C \uC5BB\uAE30 \uC804\uC5D0 \uBD88\uB800\uB2E4.",new Error("playOneShot(empty)").stack),a(!1);try{t?.(!1)}catch{}return{el:{},stop:()=>{},done:r}}let l=!1;const s=u=>{if(!l){l=!0;try{t?.(u)}catch{}a(u)}};let i;try{i=new Audio(e)}catch{return s(!1),{el:{},stop:()=>{},done:r}}i.onended=()=>s(!0),i.onerror=()=>s(!1);try{i.play().catch(()=>s(!1))}catch{s(!1)}return{el:i,stop:()=>{try{i.pause()}catch{}s(!1)},done:r}}function G2(e,t){if(!e)return{previewCodes:[],previewBucket:null};const a=e,r=i=>i.map(u=>u?.contextCode||u?.context_code).filter(Boolean).map(String);if(t==="LISTEN_IN_NOISE"){const i=a.sentences||a.items||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}if(t==="SHORT_STORY"){const i=a.items||a.sentences||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"SHORT_S"}}if(t==="LONG_STORY"){const i=a.items||a.sentences||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LONG"}}if(t==="ORDERING_SENTENCE"){const i=a.sentences||a.items||[],u=Array.isArray(i)&&i.length>0?r(i):[];return u.length===0&&(a.contextCode||a.context_code)&&u.push(String(a.contextCode||a.context_code)),{previewCodes:u,previewBucket:"LIN_D"}}const l=a.sentences||a.items||[],s=r(Array.isArray(l)?l:[]);return s.length===0&&(a.contextCode||a.context_code)&&s.push(String(a.contextCode||a.context_code)),{previewCodes:s,previewBucket:null}}function K2(e,t){const[a,r]=o.useState(!1),[l,s]=o.useState(-1),[i,u]=o.useState({key:"",urls:[]}),c=o.useRef(null),d=o.useRef(!1),m=o.useRef(null),p=o.useRef(null),[f,b]=o.useState(!1),x=o.useRef([]),{previewCodes:C,previewBucket:h}=G2(e,t),_=`${C.join(",")}|${h??""}`,g=o.useMemo(()=>i.key===_?i.urls:[],[i,_]);o.useEffect(()=>{if(!C.length)return;let y=!1;return(async()=>{const w=[],v=[];for(const B of C)try{const k=yl(B,h);if(!k){w.push("");continue}let E=null;try{E=await vl(k)}catch{}if(!E)try{const D=await xl(k);D&&(E=URL.createObjectURL(D),v.push(E))}catch{}w.push(E??"")}catch{w.push("")}y?v.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}):(x.current.forEach(B=>{try{URL.revokeObjectURL(B)}catch{}}),x.current=v,u({key:_,urls:w}))})(),()=>{y=!0}},[C.join(","),h]),o.useEffect(()=>()=>{x.current.forEach(y=>{try{URL.revokeObjectURL(y)}catch{}}),x.current=[]},[]);const A=o.useCallback(async y=>{if(y.stopPropagation(),y.preventDefault(),d.current){m.current&&pr(m.current),d.current=!1;try{c.current?.pause()}catch{}r(!1),s(-1);return}if(!g.filter(Boolean).length)return;let w=null;const v=()=>{d.current=!1,w?.stop()};m.current=v;const B=dr(v);d.current=!0,r(!0);for(let k=0;k<g.length&&d.current;k++){const E=g[k];if(E&&(s(k),w=mr(E),c.current=w.el,!await w.done))break}B(),m.current===v&&(m.current=null,d.current=!1,r(!1),s(-1))},[g]);return o.useEffect(()=>()=>{m.current&&pr(m.current),d.current=!1;try{c.current?.pause()}catch{}c.current=null},[]),{playing:a,playingIndex:l,previewUrls:g,previewHover:f,setPreviewHover:b,previewBtnRef:p,handlePreview:A}}const Y2=e=>{if(!e)return[];const t=typeof e.context=="string"&&e.context.trim()||typeof e.sentence=="string"&&e.sentence.trim()||typeof e.text=="string"&&e.text.trim()||"";if(t)return[String(t)];const a=e.sentences||e.items||e.questions||[];return Array.isArray(a)&&a.length>0?a.map(r=>{if(typeof r=="string")return r;if(r&&typeof r=="object"){const l=r;return l.sentence||l.text||l.context||l.question||l.title||""}return""}).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()):[]};function Lo(e){const{index:t,type:a,trainingData:r,ariaLabel:l,depth:s,renderPopup:i,completed:u,completedIds:c,selectedIds:d,tooltipText:m,useDescriptionTooltip:p=!1,onRemove:f,hideCheckBadge:b=!1,showTypeLabel:x=!1,onComplete:C,onSelect:h,onMore:_,countLabelOverride:g,size:A="square"}=e||{},{t:y}=xe.useTranslation(),[w,v]=o.useState(!1),B=o.useRef(null),[k,E]=o.useState(!1);o.useEffect(()=>{B.current?.matches(":hover")&&E(!0)},[]);const{playing:D,playingIndex:N,previewUrls:I,previewHover:P,setPreviewHover:K,previewBtnRef:T,handlePreview:M}=K2(r,a?.key),L=o.useCallback(()=>{h?h():v(!0)},[h]),Q=o.useCallback(()=>v(!1),[]),H=o.useCallback(()=>E(!0),[]),O=o.useCallback(()=>E(!1),[]),U=o.useCallback(()=>K(!0),[K]),$=o.useCallback(()=>K(!1),[K]),[V,z]=o.useState(null);o.useLayoutEffect(()=>{P&&z(T.current?.getBoundingClientRect()??null)},[P,T]);const[Y,S]=o.useState(null);o.useLayoutEffect(()=>{k&&!w&&p&&S(B.current?.getBoundingClientRect()??null)},[k,w,p]);const R=o.useCallback(we=>{we.target===we.currentTarget&&(we.key==="Enter"||we.key===" ")&&(we.preventDefault(),L())},[L]),F=r||null,Z=o.useMemo(()=>{if(!p)return null;const we=m?(Array.isArray(m)?m:[m]).filter(Boolean):null,Ue=we&&we.length>0?we:Y2(F);return Ue&&Ue.length>0?Ue:null},[p,m,F]),pe=o.useCallback(we=>{we.stopPropagation(),f?.()},[f]),re=o.useCallback(we=>we.stopPropagation(),[]),oe=o.useCallback(we=>{typeof C=="function"&&C(we)},[C]),ne=u||(c&&r?.id!=null?c.has(String(r.id)):!1),W=!ne&&(d!=null&&r?.id!=null?d.has(String(r.id)):!1);Li("speechear.popup.close",Q);const ie=ql(),q=`${a?.label||""} ${t+1}`,G=F?.title||F?.name||q;let de=a?.icon,Ee,ye="",me="";try{const we=F?.category_0||F?.category_main_code||F?.category_main,Ue=F?.category_1||F?.category_sub_code||F?.category_sub,ke=ie.find($e=>$e.key===we);ke?.icon&&(de=ke.icon),!Ee&&ke?.color&&(Ee={"--t-item-fg":ke.color}),!Ee&&F?.iconColor&&(Ee={"--t-item-fg":F.iconColor}),ye=ke?y(`topic.${ke.key}`,{defaultValue:ke.label||""}):"";try{const $e=ke?.subs?.find(je=>je.key===Ue);me=$e?y(`topic.sub.${$e.key}`,{defaultValue:$e.label||""}):""}catch{}}catch{}const se=me?`${ye} / ${me}`:ye||a?.label||G,Ce=we=>y("training.countQuestions",{n:we,count:we}),ge=we=>y("training.countSentences",{n:we,count:we});let ce="";try{if(F)if(a?.key==="LISTEN_IN_NOISE"){let we=0;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0?we=F.sentences.length:F.sentences&&(we=1),ce=ge(we)}else if(a?.key==="SHORT_STORY"){let we=1;Array.isArray(r?.items)?we=r.items.length:Array.isArray(r?.raw&&r.raw?.items)?we=r.raw.items.length:Array.isArray(F?.questions)?we=F.questions.length:Array.isArray(F?.sentences)&&(we=F.sentences.length),ce=Ce(we)}else if(a?.key==="LONG_STORY"){let we=1;if(Array.isArray(F.items)&&F.items.length>0){const Ue=F.items.reduce((ke,$e)=>{const je=$e.questionItems;return Array.isArray(je)?ke+je.length:Array.isArray($e.questions)?ke+$e.questions.length:ke},0);we=Ue>0?Ue:F.items.length}else Array.isArray(F.questions)&&F.questions.length>0?we=F.questions.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length);ce=Ce(we)}else if(a?.key==="ORDERING_SENTENCE"){let we=1;Array.isArray(F.items)&&F.items.length>0?we=F.items.length:Array.isArray(F.sentences)&&F.sentences.length>0&&(we=F.sentences.length),ce=ge(we)}else Array.isArray(F.items)&&(ce=F.items.length>0?Ce(F.items.length):"")}catch{}const Me=A==="row",Oe=A==="list"||Me,Le=A==="compact",ze=A==="small",We=ze&&a?.key?LC().find(we=>we.key===a.key):void 0,dt=We?Ul[We.key]:void 0,lt=We?dt?y(`trainingType.${dt}.title`,{defaultValue:We.label}):We.label??"":"",at=x&&a?.label&&a.label!==String(G)?String(a.label):ze&&lt&&lt!==String(G)?lt:"",mt=!!at,Ae=g!==void 0?g:ce,qe=[at,typeof G=="string"?G:"",Ae].map(we=>String(we??"").trim()).filter(Boolean).join(" ");return n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:B,className:`training-block-button${Oe?" training-block-button--list":""}${Me?" training-block-button--row":""}${Le?" training-block-button--compact":""}${ze?" training-block-button--small":""}${ne?" training-block-button--completed":""}${W?" training-block-button--selected":""}${mt&&!ze?" training-block-button--withType":""}${ze&&!mt?" training-block-button--no-type-label":""}`,onClick:L,onPointerEnter:H,onPointerLeave:O,role:"button",tabIndex:0,onKeyDown:R,"aria-label":typeof l=="string"?l:qe||void 0,title:!p&&m&&(Array.isArray(m)?m.filter(Boolean).join(`
824
824
  `):m)||void 0,children:[n.jsxs("div",{className:"training-block-button__left",children:[x&&a?.label&&a.label!==String(G)&&n.jsx("span",{className:"training-block-button__type-label caption-1",children:a.label}),ze&&lt&&lt!==String(G)&&n.jsx("span",{className:"training-block-button__type-label caption-2",children:lt}),n.jsx(du,{icon:de,label:G,tooltip:se,wrapperStyle:Ee,iconSize:ze||Le?"small":"medium"}),!b&&(ne||W)&&!(f&&k)&&n.jsx(Et,{className:f?"training-block-button__check--removable":void 0,type:"dot",icon:"check",position:"top-left",size:"medium","aria-label":ne?y("training.completed","\uD6C8\uB828 \uC644\uB8CC"):y("training.selected","\uC120\uD0DD\uB428")}),f&&n.jsx(Et,{className:`training-block-button__remove${k?" is-hover":""}`,type:"dot",icon:"remove",position:"top-left",size:"medium","aria-label":y("common.remove","\uC81C\uAC70"),onClick:pe}),n.jsx("div",{className:`training-block-button__title ${Le?"body-3":ze?"body-3b":"h3"}`,children:String(G)}),n.jsxs("div",{className:"training-block-button__description",children:[Ae?n.jsx("div",{className:`training-block-button__count ${ze?"caption-2":"caption-1"}`,children:Ae}):null,n.jsx("div",{className:"training-block-button__chevron",children:n.jsx(Qe,{icon:"chevron-right",label:y("training.next","\uB2E4\uC74C"),className:"training-block-button__chevron-icon",imgClassName:"training-block-button__chevron-icon-image",maskClassName:"training-block-button__chevron-icon-mask",svgClassName:"training-block-button__chevron-icon-svg",size:ze?12:20})})]}),(Oe&&!Me||ze)&&I.length>0&&n.jsx("div",{ref:T,className:"training-block-button__preview","data-tooltip-ignore":!0,onClick:re,onPointerEnter:U,onPointerLeave:$,children:n.jsx(fe,{htmlType:"button",size:ze?28:32,type:"dot",icon:D?"pause":"play",variant:ze?"transparent-lightGray":"default",useBorder:!1,selected:D,ariaLabel:String(G).trim()?D?y("training.stopFor",{name:G,defaultValue:`${G} \uC815\uC9C0`}):y("training.previewFor",{name:G,defaultValue:`${G} \uBBF8\uB9AC \uB4E3\uAE30`}):D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),onClick:M})})]}),_&&n.jsx("div",{className:"training-block-button__more","data-tooltip-ignore":!0,onClick:we=>{we.stopPropagation(),_(we)},children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"more-horizontal",variant:"transparent-lightGray",useBorder:!1,ariaLabel:String(G).trim()?y("common.moreFor",{name:G}):y("common.more","\uB354\uBCF4\uAE30")})})]}),P&&n.jsx(wn,{anchorRect:V,text:D?y("training.stop","\uC815\uC9C0"):y("training.preview","\uBBF8\uB9AC \uB4E3\uAE30"),offset:8,onClose:$}),k&&!w&&p&&(Z?n.jsx(Kn,{anchorRect:Y,items:Z,activeIndex:N,onClose:O}):F?.subTitle?n.jsx(wn,{anchorRect:Y,text:F.subTitle,offset:8,onClose:O}):null),w&&i&&i({trainingData:F,typeKey:a?.key??"",onClose:Q,onComplete:oe,popupTitle:String(G),popupSubTitle:a?.subTitle,depth:s!=null?String(s):void 0,popupIcon:de,popupIconTooltip:String(se),popupWrapperStyle:Ee})]})}const pu=200;function Z2(e){return e.itemId?(FC()[e.trainingType]??[]).find(t=>t?.id!=null&&String(t.id)===String(e.itemId))??null:null}function mu({plan:e,groups:t,anchorRect:a,offset:r=12,onClose:l}){const{t:s}=xe.useTranslation(),i=o.useMemo(()=>t?t.map((c,d)=>({key:c.key??c.type?.key??String(d),label:c.label,type:c.type,data:c.items??[]})).filter(c=>c.data.length>0):zC(s).map(c=>{const d=(e?.items??[]).filter(m=>m.trainingType===c.key);return{key:c.key,label:c.label,type:c,pickedCount:d.length,data:d.map(Z2).filter(m=>m!=null)}}).filter(c=>c.pickedCount>0),[t,e?.items,s]);if(i.length===0)return null;const u=n.jsx("div",{className:"tooltip-training__box",children:n.jsx("div",{className:"tooltip-training__groups",children:i.flatMap(({key:c,label:d,type:m,data:p},f)=>[f>0?n.jsx("div",{className:"tooltip-training__divider"},`div-${c}`):null,n.jsxs("div",{className:"tooltip-training__section",children:[n.jsx("div",{className:"tooltip-training__section-header",children:n.jsx("span",{className:"tooltip-training__type-label body-3b",children:d})}),n.jsx("div",{className:"tooltip-training__items",children:p.map((b,x)=>n.jsx(Lo,{index:x,type:m,trainingData:b,size:"compact",hideCheckBadge:!0},String(b.id??x)))})]},c)])})});return a?n.jsx(hn,{anchorRect:a,offset:r,onClose:l,closeOnOutsideClick:!1,className:"tooltip-training",ariaLabel:s("tooltip.training","\uD6C8\uB828 \uC548\uB0B4"),children:u}):u}const X2=200;function J2({icon:e,count:t,title:a,plan:r,tooltip:l=!0,hoverAccent:s=!1,className:i="",onClick:u,onMouseEnter:c,onMouseLeave:d}){const m=!!u||!!c||l&&!!r,p=_e("count-tile",m&&"count-tile--interactive",m&&s&&"count-tile--accent",u&&"count-tile--clickable",i),f=o.useRef(null),[b,x]=o.useState(null),C=o.useRef(null),h=o.useRef(null),_=!!(b&&r&&l),g=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),A=o.useCallback(()=>{g(),x(null)},[g]),y=o.useCallback(()=>{!l||!r||(g(),C.current=setTimeout(()=>{C.current=null,x(f.current?.getBoundingClientRect()??null)},pu))},[l,r,g]),w=o.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null),!h.current&&(h.current=setTimeout(()=>{h.current=null,x(null)},X2))},[]);return o.useEffect(()=>()=>{g()},[g]),o.useEffect(()=>{(!l||!r)&&A()},[l,r,A]),o.useEffect(()=>{if(!_)return;const v=k=>k instanceof Element&&(f.current?.contains(k)||!!k.closest(".tooltip-training")),B=k=>{v(k.target)?g():w()};return document.addEventListener("pointerover",B,!0),()=>document.removeEventListener("pointerover",B,!0)},[_,g,w]),n.jsxs(n.Fragment,{children:[n.jsxs("div",{ref:f,className:p,onClick:u?v=>{A(),u(v)}:void 0,onKeyDown:u?v=>{v.key!=="Enter"&&v.key!==" "||(v.preventDefault(),v.currentTarget.click())}:void 0,onPointerEnter:v=>{v.pointerType==="touch"||v.pointerType==="pen"?A():y()},onMouseEnter:c,onMouseLeave:v=>{w(),d?.(v)},role:u?"button":"img",tabIndex:u?0:void 0,"aria-label":`${a} ${t}`,children:[n.jsx(Qe,{icon:e,size:20,className:"count-tile__icon"}),n.jsx("span",{className:"count-tile__count h5","aria-hidden":"true",children:t})]}),b&&r&&n.jsx(mu,{plan:r,anchorRect:b,onClose:A})]})}let Va=0,hu="",$o="",qa=0;function fu(){return Cu(!1)}function Q2(){return Cu(!0)}function Cu(e){const t=typeof document<"u";Va===0&&t&&(hu=document.body.style.overflow,document.body.style.overflow="hidden"),e&&t&&(qa===0&&($o=document.body.style.paddingRight),qa++,document.body.style.paddingRight="0px"),Va++;let a=!1;return()=>{a||(a=!0,Va=Math.max(0,Va-1),e&&t&&(qa=Math.max(0,qa-1),qa===0&&($o?document.body.style.paddingRight=$o:document.body.style.removeProperty("padding-right"))),Va===0&&t&&(document.body.style.overflow=hu))}}function ev(){return n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":!0,children:n.jsx("path",{d:"M6 6l12 12M18 6 6 18"})})}function tv({open:e,onClose:t,ariaLabel:a,title:r,children:l,size:s="md",closeOnBackdrop:i=!0,closeOnEscape:u=!0,showClose:c=!0,className:d,contentClassName:m}){const{t:p}=xe.useTranslation(),f=o.useId(),b=o.useRef(null),x=o.useCallback(()=>t(),[t]);o.useEffect(()=>{if(!e)return;const g=document.activeElement,A=fu(),y=b.current;return fo(y,g),y?.focus(),()=>{A();const w=document.activeElement;(!w||w===document.body||y&&y.contains(w))&&Co(g)?.focus?.()}},[e]);const C=o.useRef(x),h=o.useRef(u);o.useEffect(()=>{C.current=x,h.current=u}),o.useEffect(()=>{if(e)return Gn(()=>{h.current&&C.current()})},[e]);const _=o.useRef(!1);return mo(b,e),!e||typeof document>"u"?null:nn.createPortal(n.jsx("div",{className:_e("dialog",d),onPointerDown:i?g=>{_.current=g.target===g.currentTarget}:void 0,onMouseDown:g=>{g.target===g.currentTarget&&g.preventDefault()},onClick:i?g=>{const A=_.current;_.current=!1,A&&g.target===g.currentTarget&&x()}:void 0,children:n.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":r?void 0:a,"aria-labelledby":r?f:void 0,tabIndex:-1,className:_e("dialog__surface",`dialog__surface--${s}`,m),onClick:g=>g.stopPropagation(),children:[r?n.jsx("div",{className:"dialog__header",children:n.jsx("h2",{id:f,className:"dialog__title h4b",children:r})}):null,c?n.jsx("button",{type:"button",className:"dialog__close","aria-label":p("common.close","\uB2EB\uAE30"),onClick:x,children:n.jsx(ev,{})}):null,n.jsx("div",{className:"dialog__body",children:l})]})}),document.body)}function nv({columns:e,rows:t,rowKey:a,title:r,toolbar:l,empty:s,loading:i,caption:u,className:c=""}){const{t:d}=xe.useTranslation(),m=!i&&t.length===0;return n.jsxs("div",{className:_e("board",c),children:[r||l?n.jsxs("div",{className:"board__head",children:[r?n.jsx("h2",{className:"board__title",children:r}):n.jsx("span",{}),l?n.jsx("div",{className:"board__toolbar",children:l}):null]}):null,n.jsxs("table",{className:"board__table",children:[u?n.jsx("caption",{className:"board__caption",children:u}):null,n.jsx("thead",{children:n.jsx("tr",{children:e.map(p=>n.jsx("th",{scope:"col",className:_e("board__th",`board__cell--${p.headerAlign??p.align??"left"}`),style:p.width?{width:p.width}:void 0,children:p.header},p.key))})}),n.jsx("tbody",{children:i?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:i})}):m?n.jsx("tr",{children:n.jsx("td",{className:"board__state",colSpan:e.length,children:s??d("board.empty","\uB4F1\uB85D\uB41C \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):t.map((p,f)=>n.jsx("tr",{className:"board__row",children:e.map(b=>n.jsx("td",{className:_e("board__td",`board__cell--${b.align??"left"}`),children:b.render(p,f)},b.key))},a(p,f)))})]})]})}function av({name:e,role:t,photo:a,media:r,credentials:l,size:s=190,className:i=""}){return n.jsxs("div",{className:_e("person-card",i),children:[n.jsx("div",{className:"person-card__photo",style:{width:s,height:s},children:r??(a?n.jsx("img",{src:a,alt:t?`${e} ${t}`:e}):null)}),n.jsx("h3",{className:"person-card__name",children:e}),t?n.jsx("p",{className:"person-card__role",children:t}):null,l?.length?n.jsx("ul",{className:"person-card__credentials",children:l.map(u=>n.jsx("li",{children:u},u))}):null]})}function rv({groups:e,className:t=""}){return n.jsx("div",{className:_e("timeline",t),children:e.map(a=>n.jsxs("section",{className:"timeline__group",children:[n.jsx("h3",{className:"timeline__title",children:a.title}),n.jsx("ul",{className:"timeline__rows",children:a.entries.map((r,l)=>n.jsxs("li",{className:"timeline__row",children:[r.label?n.jsx("span",{className:"timeline__label",children:r.label}):null,n.jsx("div",{className:"timeline__items",children:r.items.map((s,i)=>n.jsx("p",{children:s},i))})]},`${r.label??""}-${l}`))})]},a.title))})}function ov({title:e,kind:t,body:a,badge:r,badgeSrc:l,footer:s,width:i,className:u=""}){const c=r??(l?n.jsx("img",{src:l,alt:""}):null);return n.jsxs("div",{className:_e("publication-card",u),style:i?{width:i,flexShrink:0}:void 0,children:[c?n.jsx("div",{className:"publication-card__badge","aria-hidden":"true",children:c}):null,n.jsx("h3",{className:"publication-card__title",children:e}),t?n.jsx("p",{className:"publication-card__kind",children:t}):null,n.jsx("p",{className:"publication-card__body",children:a}),s?n.jsx("div",{className:"publication-card__footer",children:s}):null]})}function sv({logo:e,alt:t,onDone:a,durationMs:r=3e3}){const l=$a(a);return o.useEffect(()=>{const s=setTimeout(()=>l.current?.(),r);return()=>clearTimeout(s)},[r,l]),n.jsx("div",{className:"splash-logo",style:{"--splash-logo-duration":`${r}ms`},"aria-hidden":"true",children:n.jsx("img",{src:e,alt:t,className:"splash-logo__image"})})}function lv({eyebrow:e,eyebrowIndex:t,title:a,description:r,level:l=2,tone:s="dark",className:i=""}){const u=l===1?"h1":"h2";return n.jsxs("div",{className:_e("section-header",`section-header--${s}`,i),children:[e?n.jsxs("p",{className:"section-header__eyebrow",children:[t?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"section-header__index",children:t}),n.jsx("span",{"aria-hidden":!0,className:"section-header__rule"})]}):null,e]}):null,a?n.jsx(u,{className:"section-header__title",children:a}):null,r?n.jsx("div",{className:"section-header__description",children:r}):null]})}function iv({items:e,className:t=""}){return n.jsx("ul",{className:_e("company-meta",t),children:e.map((a,r)=>n.jsxs("li",{className:"company-meta__item",children:[r>0?n.jsx("span",{"aria-hidden":!0,className:"company-meta__divider",children:"|"}):null,a]},a))})}function gu(e){return typeof e=="string"?e:e.label}function bu({value:e,onChange:t,suggestions:a,openOnFocus:r=!1,filterSuggestions:l,onSelectSuggestion:s,autoActiveFirst:i=!1}){const u=o.useId(),[c,d]=o.useState(!1),[m,p]=o.useState(-1),f=o.useRef(null),b=o.useMemo(()=>{if(!a.length)return[];const N=e??"";return l===!1?a:N?typeof l=="function"?l(a,N):a.filter(I=>gu(I).toLowerCase().includes(N.toLowerCase())):r?a:[]},[a,e,r,l]),[x,C]=o.useState(!1),h=o.useRef([]),_=x&&b.length===0?h.current:b;o.useEffect(()=>{_.length&&(h.current=_)},[_]);const g=o.useCallback(()=>C(!0),[]),A=o.useCallback(()=>C(!1),[]),y=i?0:-1;o.useEffect(()=>{c||p(y)},[c,y]),o.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const w=m<_.length?m:y<_.length?y:-1,v=o.useCallback(N=>{s?s(N):t?.(gu(N)),d(!1)},[t,s]),B=o.useCallback(()=>d(!0),[]),k=o.useCallback(()=>{d(!0),p(y)},[y]),E=o.useCallback(()=>{f.current=setTimeout(()=>d(!1),120)},[]),D=o.useCallback(N=>{N.nativeEvent.isComposing||N.keyCode===229||(N.key==="ArrowDown"?(N.preventDefault(),d(!0),p(I=>Math.min(_.length-1,(I<_.length?I:y)+1))):N.key==="ArrowUp"?(N.preventDefault(),p(I=>Math.max(y,(I<_.length?I:_.length)-1))):N.key==="Enter"?w>=0&&v(_[w]):N.key==="Escape"&&c&&(N.preventDefault(),d(!1)))},[_,w,c,v,y]);return{listId:u,open:c,activeIdx:w,filtered:_,handleFocus:B,handleBlur:E,handleInput:k,handleKeyDown:D,handleSelect:v,handleCompositionStart:g,handleCompositionEnd:A}}const Ro=typeof window<"u"?o.useLayoutEffect:o.useEffect;function Xn(e){const{value:t,defaultValue:a,name:r,inputRef:l,onChange:s,label:i,ariaLabel:u,ariaDescribedBy:c,required:d,placeholder:m,ghostText:p,ghostHint:f,type:b="text",disabled:x=!1,readOnly:C=!1,error:h,helperText:_,maxLength:g,size:A=40,variant:y="input",fullWidth:w=!1,newline:v=!1,multiline:B=!1,rows:k=3,leftIcon:E,rightIcon:D,clearable:N=!1,list:I,showCount:P=!0,className:K="",onFocus:T,onBlur:M,onKeyDown:L,onEnter:Q,inputMode:H,autoComplete:O,autoFocus:U,suggestions:$,filterSuggestions:V,onSelectSuggestion:z,autoActiveFirst:Y,openOnFocus:S=!1}=e,R=C||x?void 0:$,{t:F}=xe.useTranslation(),Z=o.useId();!i&&!u&&St(`TextField:unnamed:${Z}`,"[ihab/TextField] \uC774\uB984\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 label \uC774\uB098 ariaLabel \uC911 \uD558\uB098\uB97C \uC8FC\uC138\uC694. placeholder \uB294 \uC774\uB984\uC744 \uB300\uC2E0\uD558\uC9C0 \uBABB\uD569\uB2C8\uB2E4.");const pe=`tf-${Z}`,re=`tf-helper-${Z}`,oe=o.useRef(null),ne=bu({value:t??"",onChange:s,suggestions:R??[],openOnFocus:S,filterSuggestions:V,onSelectSuggestion:z,autoActiveFirst:Y}),W=!!R&&ne.open&&ne.filtered.length>0,ie=o.useRef(null),[q,G]=o.useState(null),de=o.useCallback(()=>{const Ae=ie.current;if(!Ae||typeof window>"u")return;const qe=Ae.getBoundingClientRect(),we=230,Ue=window.innerHeight-qe.bottom<we+8&&qe.top>we+8;G({position:"fixed",left:qe.left,width:qe.width,...Ue?{bottom:window.innerHeight-qe.top+8}:{top:qe.bottom+8},zIndex:Ia(Ae)})},[]);Ro(()=>{if(!W)return;de();let Ae=null;const qe=()=>{if(typeof requestAnimationFrame>"u"){de();return}Ae===null&&(Ae=requestAnimationFrame(()=>{Ae=null,de()}))},we=Ue=>{const ke=Ue.target;ke&&ke.nodeType===1&&ke.closest?.(".text-field__suggestions")||qe()};return window.addEventListener("scroll",we,!0),window.addEventListener("resize",qe),()=>{Ae!==null&&cancelAnimationFrame(Ae),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",qe)}},[W,de]);const Ee=o.useCallback(Ae=>{oe.current=Ae,typeof l=="function"?l(Ae):l&&(l.current=Ae)},[l]),ye=p?`${p}${f??F("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)")}`:m,me=t!==void 0,se=me&&b==="password",[Ce,ge]=o.useState((a??"").length),ce=me?(t??"").length:Ce,Me=o.useRef(t);Ro(()=>{Me.current=t}),o.useEffect(()=>{const Ae=oe.current;if(!se||!Ae)return;const qe=t??"";Ae.value!==qe&&(Ae.value=qe)},[se,t]),o.useEffect(()=>{if(!v||!oe.current)return;const Ae=oe.current;Ae.style.height="",Ae.scrollHeight>Ae.clientHeight&&(Ae.style.height=`${Ae.scrollHeight}px`)},[t,Ce,v]);const Oe=g!=null&&ce>g,Le=A===32?16:20,ze=_e("text-field",`text-field--s${A}`,y==="display"?"text-field--display":"",w?"text-field--full-width":"",x?"text-field--disabled":"",C?"text-field--readonly":"",h?"text-field--error":"",E?"text-field--has-left-icon":"",D||N?"text-field--has-right-icon":"",K),We={id:pe,...se?{}:me?{value:t}:{defaultValue:a},ref:Ee,placeholder:ye,name:r,disabled:x,readOnly:C,autoFocus:U,maxLength:g,list:I,inputMode:H,autoComplete:O,"aria-label":!i&&u?u:void 0,"aria-required":d,"aria-invalid":!!h,"aria-describedby":[_||h?re:null,c].filter(Boolean).join(" ")||void 0,role:R?"combobox":void 0,"aria-autocomplete":R?"list":void 0,"aria-haspopup":R?"listbox":void 0,"aria-expanded":R?W:void 0,"aria-controls":W?ne.listId:void 0,"aria-activedescendant":W&&ne.activeIdx>=0?`${ne.listId}-option-${ne.activeIdx}`:void 0,onChange:Ae=>{const qe=Ae.target;me||ge(qe.value.length),s?.(qe.value),R&&ne.handleInput(),se&&queueMicrotask(()=>{const we=Me.current??"";qe.value!==we&&(qe.value=we)})},onCompositionStart:R?ne.handleCompositionStart:void 0,onCompositionEnd:R?ne.handleCompositionEnd:void 0,onFocus:(Ae=>{T?.(Ae),R&&ne.handleFocus()}),onBlur:(Ae=>{M?.(Ae),R&&ne.handleBlur()}),onKeyDown:(Ae=>{const qe=(Ae.key==="Tab"&&!Ae.shiftKey||Ae.key===" ")&&!Ae.nativeEvent.isComposing;if(p&&qe&&!C&&!x&&!(Ae.currentTarget.value??"").trim()){Ae.preventDefault();const we=Ae.currentTarget;me||(we.value=p,ge(p.length)),s?.(p);return}R&&Ae.key==="Enter"&&!Ae.nativeEvent.isComposing&&ne.activeIdx>=0?Ae.preventDefault():Q&&Ae.key==="Enter"&&!Ae.nativeEvent.isComposing&&(Ae.preventDefault(),Q()),L?.(Ae),R&&ne.handleKeyDown(Ae)})},dt=N&&!x&&!C&&ce>0,lt=()=>v?n.jsx("textarea",{...We,className:"text-field__input text-field__input--auto body-2",rows:1}):B?n.jsx("textarea",{...We,className:"text-field__input text-field__input--textarea body-2",rows:k}):n.jsx("input",{...We,type:b,className:"text-field__input body-2"}),at=y==="display"&&!v&&!B&&!!ye,mt=()=>n.jsxs(n.Fragment,{children:[lt(),at&&n.jsx("span",{className:"text-field__placeholder","aria-hidden":"true",children:ye})]});return n.jsxs("div",{ref:ie,className:ze,children:[i&&n.jsxs("label",{htmlFor:pe,className:"text-field__label caption-1",children:[i,d&&n.jsx("span",{className:"text-field__required",children:"*"})]}),n.jsxs("div",{className:"text-field__wrap",children:[E&&n.jsx("span",{className:"text-field__icon text-field__icon--left",children:n.jsx(Qe,{icon:E,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})}),mt(),g!=null&&P&&n.jsxs("span",{className:`text-field__count caption-2${Oe?" text-field__count--over":""}`,children:[ce,"/",g]}),dt&&n.jsx(fe,{size:24,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,className:"text-field__clear",ariaLabel:F("textField.clearAriaLabel","\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"),htmlType:"button",onMouseDown:Ae=>{Ae.preventDefault()},onClick:()=>{!me&&oe.current&&(oe.current.value="",ge(0)),s?.("")},tabIndex:-1}),D&&!dt&&n.jsx("span",{className:"text-field__icon text-field__icon--right",children:n.jsx(Qe,{icon:D,label:"",className:"",svgClassName:"text-field__icon-svg",size:Le})})]}),!!R&&n.jsx("span",{className:"text-field__status",role:"status","aria-live":"polite",children:ne.open&&(t??"").length>0&&ne.filtered.length===0?F("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"):""}),W&&(typeof document>"u"?null:nn.createPortal(n.jsx("ul",{id:ne.listId,className:"text-field__suggestions",role:"listbox",style:q??{position:"fixed",visibility:"hidden"},"data-tooltip-ignore":!0,children:ne.filtered.map((Ae,qe)=>n.jsx("li",{id:`${ne.listId}-option-${qe}`,role:"option","aria-selected":qe===ne.activeIdx,className:`text-field__suggestion body-2${qe===ne.activeIdx?" is-active":""}`,onMouseDown:we=>we.preventDefault(),onClick:()=>{ne.handleSelect(Ae),oe.current?.focus()},children:typeof Ae=="string"?Ae:n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-field__suggestion-label",children:Ae.label}),Ae.hint&&n.jsx("span",{className:"text-field__suggestion-hint caption-1",children:Ae.hint})]})},typeof Ae=="string"?`${Ae}-${qe}`:Ae.id))}),document.body)),(_||h)&&n.jsx("div",{className:"text-field__footer",children:n.jsx("span",{id:re,className:"text-field__helper caption-1",role:h?"alert":void 0,children:h||_})})]})}function cn({options:e,value:t,onChange:a,placeholder:r,disabled:l=!1,block:s=!1,size:i=48,error:u=!1,className:c="",ariaLabel:d,ariaDescribedBy:m}){const{t:p}=xe.useTranslation(),f=r??p("dropdown.placeholder","\uC120\uD0DD"),b=o.useId(),x=o.useId(),C=o.useRef(null),h=o.useCallback((T,M)=>{const L=window.innerHeight-T.bottom<260&&T.top>260;return{position:"fixed",left:T.left,minWidth:T.width,...L?{bottom:window.innerHeight-T.top+6}:{top:T.bottom+6},zIndex:Ia(M)}},[]),{open:_,setOpen:g,toggle:A,style:y,triggerRef:w,menuRef:v}=Fa({computeStyle:h}),[B,k]=o.useState(-1),E=o.useCallback(()=>k(-1),[]),D=e.find(T=>T.value===t);o.useEffect(()=>{if(_){const T=e.findIndex(M=>M.value===t);k(T>=0?T:e.length?0:-1),requestAnimationFrame(()=>{const M=v.current;if(!M)return;const L=M.querySelectorAll(".dropdown__option")[T];L&&(M.scrollTop=Math.max(0,L.offsetTop-M.clientHeight/2+L.clientHeight/2))})}},[_]),o.useEffect(()=>{_&&k(T=>{if(T>=0&&T<e.length)return T;const M=e.findIndex(L=>L.value===t);return M>=0?M:e.length?0:-1})},[_,e.length]);const N=o.useCallback(()=>{l||A()},[l,A]),I=o.useCallback(T=>{T.disabled||l||(T.value!==t&&a?.(T.value),g(!1))},[a,g,l,t]);o.useEffect(()=>{l&&g(!1)},[l,g]);const P=o.useCallback(T=>{if(!l){if(!_){(T.key==="Enter"||T.key===" "||T.key==="ArrowDown")&&(T.preventDefault(),g(!0));return}if(T.key==="Escape"){T.preventDefault(),g(!1);return}T.key==="ArrowDown"?(T.preventDefault(),k(M=>{let L=M+1;for(;L<e.length&&e[L].disabled;)L++;return L<e.length?L:M})):T.key==="ArrowUp"?(T.preventDefault(),k(M=>{let L=M-1;for(;L>=0&&e[L].disabled;)L--;return L>=0?L:M})):(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),e[B]?I(e[B]):g(!1))}},[l,_,e,B,I,g]),K=_?n.jsx("div",{ref:v,id:b,className:"dropdown__menu","data-tooltip-ignore":!0,role:"listbox",style:y,onMouseLeave:E,onMouseDown:T=>T.preventDefault(),children:e.map((T,M)=>n.jsxs("button",{id:`${b}-option-${M}`,type:"button",role:"option","aria-selected":T.value===t,className:_e("dropdown__option body-2",T.value===t?"dropdown__option--active":"",M===B?"dropdown__option--active":"",T.disabled?"dropdown__option--disabled":""),onMouseDown:L=>L.preventDefault(),onClick:()=>I(T),onMouseEnter:()=>k(M),disabled:T.disabled,children:[n.jsx("span",{className:"dropdown__option-check",children:T.value===t&&n.jsx("svg",{viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"2 7 5.5 10.5 12 3.5"})})}),T.label]},T.value))}):null;return n.jsxs("div",{ref:C,className:_e("dropdown",`dropdown--s${i}`,_?"dropdown--open":"",s?"dropdown--block":"",u?"dropdown--error":"",c),onKeyDown:P,children:[n.jsxs("button",{ref:w,type:"button",className:"dropdown__trigger",role:"combobox","aria-haspopup":"listbox","aria-expanded":_,"aria-controls":_?b:void 0,"aria-activedescendant":_&&B>=0?`${b}-option-${B}`:void 0,"aria-label":d,"aria-describedby":[d&&D?x:"",m??""].filter(Boolean).join(" ")||void 0,"aria-invalid":u||void 0,disabled:l,onClick:N,onBlur:T=>{_&&!v.current?.contains(T.relatedTarget)&&g(!1)},children:[n.jsx("span",{id:x,className:`dropdown__trigger-label body-2${D?"":" dropdown__trigger-label--placeholder"}`,children:D?D.label:f}),n.jsx("svg",{className:"dropdown__chevron",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"4 6 8 10 12 6"})})]}),typeof document<"u"&&nn.createPortal(K,C.current?.closest(".ihabdevteam-core-scope")??document.body)]})}function hr({page:e,totalPages:t,onChange:a,prevLabel:r,nextLabel:l,className:s=""}){const{t:i}=xe.useTranslation(),u=r??i("common.prevPage","\uC774\uC804 \uD398\uC774\uC9C0"),c=l??i("common.nextPage","\uB2E4\uC74C \uD398\uC774\uC9C0"),d=Math.max(1,t),m=()=>a(Math.max(1,Math.min(d,e-1))),p=()=>a(Math.min(d,e+1));return n.jsxs("div",{className:_e("pagination",s),children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-left",ariaLabel:u,disabled:e<=1,onClick:m}),n.jsxs("span",{className:"pagination__info body-3","aria-live":"polite","aria-atomic":"true",children:[Math.min(Math.max(1,e),d)," / ",d]}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"rounded",icon:"chevron-right",ariaLabel:c,disabled:e>=t,onClick:p})]})}const Ua=new Map;function bn(e){const{t}=xe.useTranslation(),{options:a=[],value:r=a.find(y=>!y.disabled)?.key??a[0]?.key,onChange:l=y=>{},className:s="",size:i=40,shape:u="pill",useBG:c=!0,fullWidth:d=!1,minButtonWidth:m,ariaLabel:p}=e||{},f=o.useRef(null),b=a.filter(y=>!y.disabled),x=o.useId(),C=a.map(y=>y.key).join("\xB7");o.useEffect(()=>{if(!(!$n||p!=null&&p!=="")){if(Ua.set(x,C||"(\uBCF4\uAE30 \uC5C6\uC74C)"),Ua.size>1){const y=[...Ua.values()].sort();St(`segmented-control-unnamed:${y.join("|")}`,`[ihab/SegmentedControl] \uC774\uB984 \uC5C6\uB294 \uB77C\uB514\uC624\uADF8\uB8F9\uC774 \uD55C \uD654\uBA74\uC5D0 ${Ua.size} \uAC1C \uC11C \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uB0AD\uB3C5\uAE30\uB294 \uBAA8\uB450 "\uC120\uD0DD \uD0ED" \uC73C\uB85C \uC77D\uC5B4 \uC5B4\uB290 \uAC83\uC774 \uBB34\uC5C7\uC778\uC9C0 \uAC00\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. ariaLabel \uC744 \uC8FC\uC138\uC694. \uC9C0\uAE08 \uC120 \uAC83(\uBCF4\uAE30 \uC774\uB984\uC73C\uB85C \uC801\uC74C): ${y.join(" / ")}`)}return()=>{Ua.delete(x)}}},[p,C,x]);const h=y=>{if(!b.length)return;const w=Math.max(0,b.findIndex(B=>B.key===r)),v=y==="first"?b[0]:y==="last"?b[b.length-1]:b[(w+y+b.length)%b.length];v&&(l(v.key),Array.from(f.current?.querySelectorAll("[data-segkey]")??[]).find(B=>B.dataset.segkey===v.key)?.focus())},_=y=>{switch(y.key){case"ArrowRight":case"ArrowDown":h(1);break;case"ArrowLeft":case"ArrowUp":h(-1);break;case"Home":h("first");break;case"End":h("last");break;default:return}y.preventDefault()},g=y=>{const w=v=>typeof v=="string"||typeof v=="number";if(!(!w(y.label)||y.count==null||y.count===!1||!w(y.count)))return`${y.label}, ${y.count}`},A=b.some(y=>y.key===r)?r:b[0]?.key;return n.jsx("div",{ref:f,onKeyDown:_,className:_e("segmented-control",`segmented-control--${u}`,`segmented-control--${i}`,d&&"segmented-control--full",!c&&"segmented-control--no-bg",m!=null&&"segmented-control--min",s),style:m!=null?{"--segmented-min-button-w":`${m}px`}:void 0,role:"radiogroup","aria-label":p??t("segmentedControl.ariaLabel","\uC120\uD0DD \uD0ED"),children:a.map(y=>n.jsx(fe,{htmlType:"button",role:"radio","aria-checked":y.key===r,"data-segkey":y.key,tabIndex:y.key===A?0:-1,label:y.label,count:y.count,ariaLabel:g(y),disabled:y.disabled,className:y.key===r?"is-selected":"",onClick:()=>{y.disabled||l(y.key)},size:i,shape:u,useBorder:!1,useBG:!1},y.key))})}function Po({count:e,search:t,segment:a,filters:r,pageSize:l,pagination:s,actions:i,className:u}){const{t:c}=xe.useTranslation(),d=e!=null&&n.jsxs("p",{className:"toolbar__count body-1",role:"status","aria-atomic":"true",children:[e.prefix??c("common.totalPrefix","\uCD1D "),n.jsx("span",{className:"toolbar__count-highlight",children:e.value}),e.unit,e.suffix]}),m=!!(t||r?.length||l||s||i);return n.jsxs("div",{className:_e("toolbar",u),children:[n.jsxs("div",{className:"toolbar__row",children:[d,a&&(Array.isArray(a)?a:[a]).map((p,f)=>n.jsx(bn,{size:40,...p},p.ariaLabel??f))]}),m&&n.jsx("div",{className:"toolbar__row",children:n.jsxs("div",{className:"toolbar__row-end",children:[t&&n.jsx(Xn,{className:"toolbar__search",size:40,value:t.value,onChange:t.onChange,placeholder:t.placeholder??c("common.search","\uAC80\uC0C9"),ariaLabel:t.placeholder??c("common.search","\uAC80\uC0C9"),autoFocus:t.autoFocus,clearable:!0}),r?.map((p,f)=>n.jsx(cn,{size:40,options:p.options,value:p.value,onChange:p.onChange,ariaLabel:p.ariaLabel},f)),(l||s)&&n.jsxs("div",{className:"toolbar__pager",children:[l&&n.jsx(cn,{size:40,options:l.options,value:l.value,onChange:l.onChange,ariaLabel:l.ariaLabel??c("common.pageSizeSelect","\uD398\uC774\uC9C0\uB2F9 \uD45C\uC2DC \uAC1C\uC218")}),s&&n.jsx(hr,{page:s.page,totalPages:s.total,onChange:s.onChange,prevLabel:s.prevLabel,nextLabel:s.nextLabel})]}),i]})})]})}function yu(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(yu).join(""):""}function uv(e){let t=e.replace(/\r\n/g,`
825
825
  `).replace(/\r/g,`
@@ -1037,7 +1037,7 @@ ${y.badge}`:y.badge:void 0;if(v&&c(y.code))return null;if(!y.badge&&!m)return p(
1037
1037
  </html>`}const j4=1e3;function ls({getElements:e,paperW:t,paperH:a,fileName:r="",onPopupBlocked:l,header:s=""}){const{t:i}=xe.useTranslation(),u=o.useCallback(()=>{S4(e(),t,a,r,s)},[e,t,a,r,s]),c=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=window.open("","_blank");if(!p){l?.();return}p.document.write(ss(m,t,a,!1,r,s)),p.document.close()},[e,t,a,r,l,s]),d=o.useCallback(()=>{const m=e();if(m.length===0)return;const p=ss(m,t,a,!1,r,s),f=new Blob([p],{type:"text/html;charset=utf-8"}),b=URL.createObjectURL(f),x=(r?os(r):"")||i("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C"),C=Object.assign(document.createElement("a"),{href:b,download:`${x}.html`});document.body.appendChild(C),C.click(),document.body.removeChild(C),setTimeout(()=>URL.revokeObjectURL(b),j4)},[e,t,a,r,s,i]);return{print:u,openNewWindow:c,downloadHtml:d}}function bc(e,t){const{t:a}=xe.useTranslation(),r=t?.paperBands===!0,[l,s]=o.useState("landscape"),[i,u]=o.useState(["image","word","standardPron"]),[c,d]=o.useState("show"),[m,p]=o.useState(!0),[f,b]=o.useState(!0),[x,C]=o.useState(!0),[h,_]=o.useState(!0),[g,A]=o.useState(8),[y,w]=o.useState("right"),v=e.length,B=e.some(Q=>(Q.words??[]).length>1),k=e.some(Q=>(Q.words??[]).some(H=>!!H.colloquialLabel)),E=Math.min(g,Math.max(v,1)),D=o.useMemo(()=>Zu(e,E),[e,E]),N=D.length>1,I=E,[P,K]=o.useState(!1);o.useEffect(()=>{let Q=!1;if(!sa()){K(!1);return}return Promise.all(e.flatMap(H=>(H.words??[]).map(O=>Nl(O.label,O.homonum)))).then(H=>{Q||K(H.some(Boolean))},()=>{}),()=>{Q=!0}},[e]);const T=o.useMemo(()=>[sc(a,{hasImage:P,hasColloquial:k}),lc(a),...v>0?[mc(a,{hasPairs:B,itemCount:v})]:[],ic(a),...I>1?[dc(a)]:[],...B?[pc(a)]:[],...r?[uc(a),cc(a)]:[]],[a,P,k,v,B,N,I,r]),M={...Cc(a,{contentTypes:i,orientation:l,showOutline:m,cutLine:c,showDivLine:h,showTopInfo:f,showBottomInfo:x}),...v>0?{[a(B?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${E}\uAC1C`}:{},...N?{[a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:y}:{}},L=o.useCallback((Q,H)=>{gc(a,Q,H,{setContentTypes:u,setOrientation:s,setShowOutline:p,setCutLine:d,setShowDivLine:_,setShowTopInfo:b,setShowBottomInfo:C})||(H===a("wordTable.filter.itemsPerPagePair","\uD398\uC774\uC9C0\uB2F9 \uB300\uB9BD\uC30D \uC218")||H===a("wordTable.filter.itemsPerPageWord","\uD398\uC774\uC9C0\uB2F9 \uB2E8\uC5B4 \uC218")?A(hc(parseInt(Q),v)):H===a("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&w(fc(Q)))},[a,v]);return{settings:{orientation:l,contentTypes:i,cutLine:c,showOutline:m,showDivLine:h,count:I,showTopInfo:f,showBottomInfo:x},filterSections:T,filterSelected:M,handleSelect:L,pages:D,isPaginated:N,pageNumberPosition:y}}function T4({items:e,words:t,title:a,subtitle:r,emptyText:l,buttons:s,renderButtons:i,renderFooter:u,footerClassName:c,footerLayout:d,printFileName:m,showSettings:p,autoPrint:f,className:b,onClose:x,scoring:C=!1,onScoreChange:h,printHeader:_,brand:g,code:A,beforeClose:y}){const{t:w}=xe.useTranslation(),v=o.useMemo(()=>Array.isArray(e)?e:(Array.isArray(t)?t:[]).filter(W=>typeof W=="string"&&W.length>0).map((W,ie)=>({id:`${W}-${ie}`,words:[{label:W}]})),[e,t]),{settings:B,filterSections:k,filterSelected:E,handleSelect:D,pages:N,isPaginated:I,pageNumberPosition:P}=bc(v,{paperBands:!!g?.show}),K=o.useMemo(()=>Yu(N.map(W=>W.length)),[N]),[T,M]=o.useState({}),L=o.useCallback((W,ie)=>{M(q=>({...q,[br(W)]:Uu(q[br(W)]??null,ie)}))},[]),Q=o.useRef(h);o.useEffect(()=>{Q.current=h});const H=o.useRef(T);o.useEffect(()=>{H.current!==T&&(H.current=T,Q.current?.(Qo(T)))},[T]);const O=o.useMemo(()=>Qo(T),[T]),U=o.useRef(null),{toastMessage:$,toastKey:V,showWarning:z,clearToast:Y}=Oi("warning"),S=o.useRef([]),R=o.useCallback(()=>I?S.current.filter(W=>W!==null):U.current?[U.current]:[],[I]),{print:F,openNewWindow:Z}=ls({getElements:R,paperW:ga[B.orientation].width,paperH:ga[B.orientation].height,fileName:m??"",header:_??"",onPopupBlocked:()=>z(w("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}),pe=o.useMemo(()=>u?void 0:i?i({print:F,openNewWindow:Z}):m?[{label:w("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),variant:"default",onClick:()=>Z()},{label:w("wordTable.print","\uC778\uC1C4\uD558\uAE30"),variant:"default",onClick:()=>F()},...s??[]]:s,[u,i,m,s,w,F,Z]),re=o.useMemo(()=>u?u({print:F,openNewWindow:Z}):void 0,[u,F,Z]),oe=o.useRef(!1),ne=o.useRef(F);return o.useEffect(()=>{ne.current=F},[F]),o.useEffect(()=>{if(!f||oe.current)return;const W=window.setTimeout(()=>{oe.current=!0,ne.current()},100);return()=>window.clearTimeout(W)},[f]),n.jsxs(On,{title:a??w("keyWords.title","\uC8FC\uC694 \uB2E8\uC5B4"),subtitle:r,size:"large",className:_e("word-table-popup",b),buttons:pe,footer:re,footerClassName:c,footerLayout:d,beforeClose:y,onClose:x,children:[v.length>0?n.jsxs("div",{className:"word-table-popup__body",children:[p&&n.jsx(as,{sections:k,selected:E,onSelect:D}),I?n.jsx("div",{className:"word-table-popup__pages",children:N.map((W,ie)=>n.jsx(ba,{items:W,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:q=>{S.current[ie]=q},pageNumber:{current:ie+1,total:N.length},pageNumberPosition:P,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A,scoring:C,scoreIndexOffset:K[ie],marks:O,onMarkClick:L},ie))}):n.jsx("div",{className:"word-table-popup__table",children:n.jsx(ba,{items:v,orientation:B.orientation,contentTypes:B.contentTypes,cutLine:B.cutLine,showOutline:B.showOutline,showDivLine:B.showDivLine,count:B.count,contentRef:U,fitHeight:!0,scoring:C,marks:O,onMarkClick:L,brand:g&&{...g,top:B.showTopInfo,bottom:B.showBottomInfo},code:A})})]}):n.jsx("p",{className:"word-table-popup__empty body-3",children:l??w("keyWords.empty","\uCD94\uCD9C\uB41C \uC8FC\uC694 \uB2E8\uC5B4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsx(ha,{message:$,position:"top",onClose:Y},V)]})}const M4=new Set(["x","triangle"]);function L4(e,t){const a=[];for(let r=0;r<e.length;r++){const l=t[String(r)];l&&M4.has(l)&&a.push(e[r])}return a}const $4=/\s*(?:(\d+)차\s*)?복습\s*\d{2}\.\d{2}$/;function yc(e){const t=e.name.trim(),a=e.reviewRound;if(typeof a=="number"&&Number.isFinite(a)&&a>=0){const s=Math.floor(a);if(s===0)return{base:t,round:1};const i=(s===1?/\s*복습\s*\d{2}\.\d{2}$/:new RegExp(`(?:^|\\s)${s}\uCC28\\s*\uBCF5\uC2B5\\s*\\d{2}\\.\\d{2}$`)).exec(t);return{base:i?t.slice(0,i.index).trim():t,round:s+1}}let r=t,l=1;for(;;){const s=$4.exec(r);if(!s)break;l=Math.max(l,(s[1]?Number(s[1]):1)+1),r=r.slice(0,s.index).trim()}return{base:r,round:l}}function R4(e,t){const[,a,r]=lo(t).split("-"),l=`${a}.${r}`,{base:s,round:i}=yc(typeof e=="string"?{name:e}:e),u=i>=2?`${i}\uCC28 `:"";return`${s||"\uB2E8\uC5B4\uD45C"} ${u}\uBCF5\uC2B5 ${l}`}function P4(e){return{reviewOf:e.reviewOf??e.id??void 0,reviewRound:yc(e).round}}function I4(e,t){const a={};for(const[r,l]of Object.entries(t)){if(l!=="o"&&l!=="triangle"&&l!=="x")continue;const s=Number(r),i=e[s];i&&(a[r]=i)}return a}function F4(e){return e.map(t=>t.label).join(" / ")}function O4(e){return e.map(t=>t.homonum!=null?`${t.label}#${t.homonum}`:t.label).join(" / ")}function vc(e){return e.split(" / ").map(t=>t.replace(/#\d+$/,"")).join(" / ")}function z4(e,t,a){const r=Hl(a);return[e.trim(),r,t.trim()].filter(Boolean).join(" \xB7 ")}function xc(e,t,a){return a===0?0:(e+t*.5)/a}function W4(e){const t=new Map,a=[...e].sort((l,s)=>l.scoredAt.localeCompare(s.scoredAt));for(const l of a)for(const[s,i]of Object.entries(l.marks)){const u=l.labels?.[s];if(!u)continue;const c=t.get(u)??{o:0,triangle:0,x:0,latest:i,latestAt:l.scoredAt};if(i==="o")c.o++;else if(i==="triangle")c.triangle++;else if(i==="x")c.x++;else continue;c.latest=i,c.latestAt=l.scoredAt,t.set(u,c)}const r=[];for(const[l,s]of t){const i=s.o+s.triangle+s.x;r.push({label:vc(l),key:l,tried:i,o:s.o,triangle:s.triangle,x:s.x,rate:xc(s.o,s.triangle,i),latest:s.latest,latestAt:s.latestAt})}return r.sort((l,s)=>l.rate-s.rate||s.tried-l.tried||on(l.label,s.label)||on(l.key??l.label,s.key??s.label)),r}function H4(e){const t=new Map;for(const r of e){const l=r.tableId??`name:${r.tableName}`,s=t.get(l)??{tableName:r.tableName,tableId:r.tableId,rows:[]};s.rows.push(r),t.set(l,s)}const a=[];for(const r of t.values()){const l=u=>Object.values(u.marks).filter(c=>c==="o"||c==="triangle"||c==="x").length,s=r.rows.filter(u=>l(u)>0).sort((u,c)=>u.scoredAt.localeCompare(c.scoredAt));if(s.length===0)continue;const i=s.map(u=>{const c=Object.values(u.marks),d=c.filter(p=>p==="o").length,m=c.filter(p=>p==="triangle").length;return xc(d,m,l(u))});a.push({tableName:r.tableName,tableId:r.tableId,rates:i,times:s.map(u=>u.scoredAt),delta:i.length>=2?i[i.length-1]-i[0]:null})}return a.sort((r,l)=>(l.times[l.times.length-1]??"").localeCompare(r.times[r.times.length-1]??"")),a}function V4(e,t=8){return e.filter(a=>a.latest!=="o").slice(0,t)}function q4(e,t){if(e==null||t==null||e===""||t==="")return 0;if(typeof e=="number"&&typeof t=="number")return e-t;const a=String(e),r=String(t);return+(a>r)-+(a<r)}function U4(e){const t=new Map;let a=0,r=0;const l=e.map((i,u)=>({r:i,at:u})).sort((i,u)=>i.r.answeredAt.localeCompare(u.r.answeredAt)||q4(i.r.id,u.r.id)||i.at-u.at).map(i=>i.r);for(const i of l){if(i.isCorrect==null)continue;const u=i.itemTitle?.trim();if(!u){r++;continue}a++;const c=i.itemId?.trim()||u,d=`${i.trainingType}|${c}`,m=t.get(d)??{trainingType:i.trainingType,itemId:c,title:u,tried:0,wrong:0,latestCorrect:i.isCorrect,latestAt:i.answeredAt,lastSelected:i.selected,setIds:[]};if(m.tried++,i.isCorrect||m.wrong++,m.title=u,m.latestCorrect=i.isCorrect,m.latestAt=i.answeredAt,m.lastSelected=i.selected,i.setId){const p=m.setIds.indexOf(i.setId);p>0&&m.setIds.splice(p,1),p!==0&&m.setIds.unshift(i.setId)}t.set(d,m)}const s=[...t.entries()].map(([i,u])=>({key:i,trainingType:u.trainingType,itemId:u.itemId,title:u.title,tried:u.tried,wrong:u.wrong,rate:u.tried===0?0:(u.tried-u.wrong)/u.tried,latestCorrect:u.latestCorrect,latestAt:u.latestAt,lastSelected:u.lastSelected,setIds:u.setIds}));return s.sort((i,u)=>i.rate-u.rate||u.tried-i.tried||on(i.title,u.title)),{items:s,counted:a,skippedNoTitle:r}}function G4(e,t=8){return e.filter(a=>!a.latestCorrect).slice(0,t)}function K4(e){const t=new Map;for(const r of e){const l=t.get(r.trainingType)??[];l.push(r),t.set(r.trainingType,l)}const a=[...t.entries()].map(([r,l])=>({trainingType:r,items:l,pending:l.filter(s=>!s.latestCorrect).length}));return a.sort((r,l)=>l.pending-r.pending||r.trainingType.localeCompare(l.trainingType)),a}const is=["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"];function Y4(e){const t=new Map;let a=0;for(const s of e){if(s.latestCorrect)continue;const i=s.setIds[0];if(!i){a++;continue}const u=`${s.trainingType}|${i}`,c=t.get(u)??{setId:i,trainingType:s.trainingType,pending:0};c.pending++,t.set(u,c)}const r=(s,i)=>i.pending-s.pending||s.trainingType.localeCompare(i.trainingType)||s.setId.localeCompare(i.setId),l=[...t.values()];return{sentence:l.filter(s=>is.includes(s.trainingType)).sort(r),word:l.filter(s=>!is.includes(s.trainingType)).sort(r),noSet:a}}function Z4(e,t,a=5){const r=new Set(t);if(r.size===0)return[];const l=[];for(const s of e){const i=new Set,u=[];for(const c of s.cellLabels)r.has(c)&&!i.has(c)&&(i.add(c),u.push(c));u.length!==0&&l.push({id:s.id,name:s.name,kind:s.kind,covered:u,totalCells:s.cellLabels.length})}return l.sort((s,i)=>i.covered.length-s.covered.length||s.totalCells-i.totalCells||on(s.name,i.name)),l.slice(0,Math.max(0,a))}function X4(e,t){const a=new Set(e.flatMap(r=>r.covered));return t.filter(r=>!a.has(r))}function J4(e,t){const a=new Map;for(const l of e)for(const s of l.cells){const i=l.labelOf(s);a.has(i)||a.set(i,s)}const r=[];for(const l of t){const s=a.get(l);s!==void 0&&r.push(s)}return r}function us(e,t,a){return typeof e=="string"&&e?e:t.replace(/\{\{(\w+)\}\}/g,(r,l)=>String(a[l]))}function Q4(e,t){const a=Number.isFinite(e)?Math.round(e):0;if(!a||a<=0)return"-";const r=Math.floor(a/60),l=a%60;return t?t(r,l):r>0&&l>0?us(Rt.t("customers.duration.minSec",{m:r,s:l,defaultValue:"{{m}}\uBD84 {{s}}\uCD08"}),"{{m}}\uBD84 {{s}}\uCD08",{m:r,s:l}):r>0?us(Rt.t("customers.duration.min",{m:r,defaultValue:"{{m}}\uBD84"}),"{{m}}\uBD84",{m:r}):us(Rt.t("customers.duration.sec",{s:l,defaultValue:"{{s}}\uCD08"}),"{{s}}\uCD08",{s:l})}function ex(e,t){const a=[],r=new Set;for(const l of e){const s=t(l);r.has(s)||(r.add(s),a.push({key:s,value:l,pinned:!1}))}return a}function tx(e,t){return e.map(a=>a.key===t?{...a,pinned:!a.pinned}:a)}function nx(e,t){return e.filter(a=>a.key!==t)}function ax(e,t,a){const r=e.filter(d=>d.pinned),l=new Set(r.map(d=>d.key)),s=e.length-r.length,i=[],u=new Set(l);for(const d of t){if(i.length>=s)break;const m=a(d);u.has(m)||(u.add(m),i.push({key:m,value:d,pinned:!1}))}const c=[...i];return e.map(d=>d.pinned?d:c.shift()).filter(d=>d!==void 0)}function rx(e){return e.map(t=>t.value)}function ox(e){const{category:t={},isSelected:a=!1,onClick:r}=e||{},l=t?.key?` icon-grid-menu__button--${t.key}`:"",s=o.useId();return n.jsxs("div",{className:`icon-grid-menu__button-wrapper${l}`,children:[n.jsx("button",{className:`icon-grid-menu__button${a?" icon-grid-menu__button--selected":""}`,"data-key":t?.key,type:"button",onClick:a?void 0:r,"aria-pressed":a,"aria-labelledby":s,children:n.jsx(Qe,{icon:t.icon,label:t.label,className:"icon-grid-menu__button-icon",imgClassName:"icon-grid-menu__button-icon-image",maskClassName:"icon-grid-menu__button-icon-mask",svgClassName:"icon-grid-menu__button-icon-svg"})}),n.jsx("span",{id:s,className:"icon-grid-menu__button-label button-1",children:t.label})]})}function sx(e){const{categories:t=[],selected:a,onSelect:r,size:l="medium"}=e||{},s=a!==void 0,[i,u]=o.useState(()=>s?null:(t&&t[0]?.key)??null),c=s?a:i,d=o.useRef(r);o.useEffect(()=>{d.current=r});const m=o.useRef(!1),p=(t&&t[0]?.key)??null;o.useEffect(()=>{if(s||m.current||!p)return;m.current=!0;const b=i??p;i==null&&u(b),d.current?.(b)},[s,p]);const f=o.useCallback(b=>{const x=c===b?null:b;m.current=!0,s||u(x),r?.(x)},[c,s,r]);return n.jsx("div",{className:`icon-grid-menu icon-grid-menu--${l}`,children:(t||[]).map(b=>n.jsx(ox,{category:b,isSelected:c===b.key,onClick:()=>f(b.key)},b.key))})}function lx({subs:e=[],selected:t,onSelect:a,size:r="medium"}){const l=r==="small"?32:40;return n.jsx("div",{className:`choice-chips choice-chips--${r}`,children:n.jsx("div",{className:"choice-chips__list",children:e.map(s=>n.jsx(fe,{htmlType:"button",size:l,type:"bar",label:s.label,selected:t===s.key,className:"choice-chips__button",onClick:()=>a?.(s.key)},s.key))})})}function ix({onTermsClick:e,onPrivacyClick:t,contact:a}={}){const r=a?.email??"support@ihab.co.kr",l=a?.tel??"031-380-3724",{t:s}=xe.useTranslation();return n.jsx("footer",{className:"site-footer",children:n.jsxs("div",{className:"safearea",children:[n.jsxs("div",{className:"site-footer__top",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("div",{className:"site-footer__lead h3",children:s("footer.lead",`\uC544\uC774\uD574\uBE0C\uB294 \uC18C\uB9AC\uB97C \uD1B5\uD574
1038
1038
  \uC2E0\uB8B0\uB97C \uC313\uACE0
1039
1039
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`).split(`
1040
- `).map((i,u,c)=>n.jsxs(o.Fragment,{children:[i,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:s("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{e&&(i.preventDefault(),e())},children:s("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{t&&(i.preventDefault(),t())},children:s("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Mo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",l]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function ux({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:l,className:s,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),m=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),b=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const y=document.getElementById(b);y&&y.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=y=>{y.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,b]);const C=i?`${i} landing-header__inner`:"landing-header__inner",h=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,g)=>n.jsx("span",{children:h(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[l,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":b,"aria-label":p?m.close:m.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:b,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:h(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function cx({children:e,action:t,onClick:a,className:r}){const l=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:l,onClick:a,...Hu(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function dx({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),l=o.useRef(null),s=o.useCallback(()=>{const C=t.current,h=C.phase!=="sound"&&C.at>0;l.current=h?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=l.current;return l.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,h,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:h,at:Date.now()-Math.max(0,_)},new Promise(A=>{const y=setTimeout(()=>{r.current===y&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=y})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),m=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),f=o.useCallback(()=>a.current,[]),b=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:b,abort:u,waitPad:c,enterSound:d,leave:m,pause:s,resume:i,__bumpGenerationForTest:x}),[p,f,b,u,c,d,m,s,i,x])}const va=9,px=e=>Math.round(Math.min(va,Math.max(0,e))/va*100),mx=e=>e/100*va,Xa=2,_c=.1,hx=e=>Math.min(Xa,Math.max(0,e)),fx=.1,Cx=e=>Math.round(e*1e6)/1e6;function Ja(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return hx(t);const a=Math.min(va,Math.max(0,Number(e.level)||0))/va,r=Number(e.mainVolume);return r>0?a>0?Cx(Math.min(Xa,Math.max(fx,a/r))):0:1}const wc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Bc(e){return wc(e)}function cs(e){return wc(e)*Ja(e)}function ds(e,t=Tf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,cs(e)/a)}function Jn(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=Ja({level:a.level,mainVolume:a.mainVolume})),a}const Qn={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},ps=o.createContext(null);function xr(){return o.useContext(ps)}const ms=e=>`${jf()}/${e}`,kc=e=>Array.from({length:10},(t,a)=>ms(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),_r={get defaultNoise(){return ms("noise1.mp3")},get street(){return kc("noise2")},get restaurant(){return kc("noise3")},get buzz(){return ms("noise4.mp3")}};function gx(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return _r.defaultNoise;case"street":return _r.street[t];case"restaurant":return _r.restaurant[t];case"buzz":return _r.buzz;default:return null}}function bx({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const l=o.useRef(e?.registerAnalyser);l.current=e?.registerAnalyser;const s=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),m=o.useRef(null),p=o.useRef(null),f=o.useRef(0),b=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]),h=o.useCallback((w,v=250)=>{const B=s.current;if(!B)return;const k=d.current;if(k){d.current=null;try{B.pause()}catch{}B.src=k,B.load()}if(!B.src)return;f.current+=1,C();try{eo(),er(B).then(I=>{if(s.current===B)try{l.current?.("noise",I)}catch{}})}catch{}const E=B.paused?0:tr(B);B.paused&&In(B,0),B.play().catch(()=>{});const D=performance.now(),N=()=>{const I=Math.min(1,(performance.now()-D)/v);try{In(B,E+(w-E)*I)}catch{}I<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((w=250,v)=>{const B=s.current;if(!B||B.paused){v?.();return}const k=++f.current;C();const E=performance.now(),D=tr(B),N=()=>{const I=Math.min(1,(performance.now()-E)/w);try{In(B,D*(1-I))}catch{}if(I<1)p.current=requestAnimationFrame(N);else{p.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);try{B.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),b.current=setTimeout(()=>{if(b.current=null,f.current===k){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{B.paused||(In(B,0),B.pause(),v?.())}catch{}}},w+150)},[C]);o.useEffect(()=>{const w=document.createElement("audio");return w.loop=!0,w.crossOrigin="anonymous",s.current=w,()=>{C();try{w.pause(),w.removeAttribute("src"),w.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?ds(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let w=0;const v=setInterval(()=>{const B=s.current;if(!B||B.paused){w=0;return}const k=t.current;if(k&&!k.paused&&!k.ended||x()||a.current==="playing"){w=0;return}w+=1,w>=2&&(w=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const w=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const B=t.current,k=!!B&&!B.paused&&!B.ended||x()||a.current==="playing",E=m.current;k&&E?.enabled&&E.volume>0&&h(E.volume)};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)},[C,h,t,a,x]),o.useEffect(()=>{m.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const y=o.useRef(null);return o.useEffect(()=>()=>{y.current?.(),y.current=null},[]),o.useEffect(()=>{const w=e?.settings,v=s.current;if(!v)return;const B=w?ds(w):0;if(!w||!w.enabled||B===0){_();return}if(c.current!==w.type){const k=gx(w.type);k&&(c.current=w.type,u(k),d.current=k,_(150,()=>{if(d.current!==k)return;d.current=null,v.src=k,v.load();const E=t.current;if(E&&!E.paused||x()){y.current?.();const D=()=>{v.removeEventListener("canplay",D),y.current===N&&(y.current=null);const I=t.current,P=m.current;(I&&!I.paused&&!I.ended||x())&&P?.enabled&&P.volume>0&&h(P.volume)},N=()=>v.removeEventListener("canplay",D);y.current=N,v.addEventListener("canplay",D)}}))}else{const k=t.current,E=!!k&&!k.paused&&!k.ended||x()||a.current==="playing";if(E&&d.current)h(B);else if(E&&v.paused&&v.src)h(B);else if(!v.paused)if(!E)_();else{C();const D=tr(v),N=performance.now(),I=()=>{const P=Math.min(1,(performance.now()-N)/150);try{In(v,D+(B-D)*P)}catch{}P<1?p.current=requestAnimationFrame(I):p.current=null};p.current=requestAnimationFrame(I)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,h,_,t,a,m,x]),o.useEffect(()=>{const w=s.current;if(w)try{w.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:i,noiseSettingsRef:m,cancelNoiseFade:C,fadeInNoise:h,fadeOutNoise:_}}function yx({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:l,setProgress:s,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:m,onDoneRef:p,handleEndRef:f}){const b=o.useRef(null),x=o.useRef(0),C=o.useRef(null),h=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{h.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(w,v=1)=>{try{const B=(w||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(w||"").length);return Math.max(700,Math.round(B*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(w=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,B=++h.current;try{try{v.cancel()}catch{}const k=w??e,E=Array.isArray(k)?k.filter(T=>!!T):[k||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((T,M)=>T+g(M,D||1),0),b.current=performance.now(),s(0),i("playing"),u("playMode");const N=m.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const I=()=>{try{const T=b.current||performance.now(),M=performance.now()-T,L=x.current||1200,Q=Math.min(1,M/L);try{r.current&&(r.current.style.left=`${Q*100}%`),l.current&&l.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(I))}catch{}},P=()=>{if(B===h.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),i("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},K=T=>{const M=new SpeechSynthesisUtterance(E[T]);try{M.rate=D}catch{}try{M.volume=Math.max(0,Math.min(1,a))}catch{}M.onend=()=>{if(B===h.current){if(T<E.length-1){try{K(T+1)}catch{P()}return}P()}},M.onerror=()=>{P()},M.onstart=()=>{if(!(T>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(I)}catch{}},_.current=!0,v.speak(M)};try{K(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,l,s,i,u,m,p,f]),y=o.useCallback(()=>{h.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),b.current=null}catch{}i("stopped"),u("active"),s(0)},[d,i,u,s]);return{startTTS:A,stopTTS:y}}const vx=.01,xx=.3;async function _x(e,t,a,r=!1){let l=null;try{const s=window.AudioContext||window.webkitAudioContext;l=new s;const i=await l.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const b=Math.floor(xx*i.sampleRate),x=Math.min(u.length,b);for(;c<x&&Math.abs(u[c])<=vx;)c++;c>=x&&(c=0)}const d=u.length-c,m=a&&a>0?Math.min(d,Math.floor(a*i.sampleRate)):d,p=Math.max(t,m),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((b,x)=>{const C=c+x*f,h=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<h;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{l?.close?.()}catch{}}}async function Ac(e,t,a,r=!1){try{const l=await fetch(e);if(l.ok===!1)return null;const s=await l.arrayBuffer();return await _x(s,t,a,r)}catch(l){try{const s=$l(l)}catch{}return null}}const hs=45,wx=74,Bx=2;function wr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Br(e){return wr(e)/45}const kx=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Nc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Ec({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Nc(t),l=Nc(a),s=[];let i=0;return e.forEach((u,c)=>{for(const[d,m]of[["lead",r],["sound",kx(u)],["tail",l]])s.push({kind:d,track:c,startMs:i,durMs:m}),i+=m}),{segments:s,totalMs:i,trackCount:e.length}}function Dc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,l,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:l,tail:s,totalMs:r.durMs+l.durMs+s.durMs}}function Ax(e,t){const a=Dc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],l=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+l)/a.totalMs))}function Nx(e,t,a){const r=Math.max(0,Math.floor(a)),l=Dc(e,t);if(!l||r===0||!(l.totalMs>0)||l.lead.durMs===0&&l.tail.durMs===0||!(l.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(l.lead.durMs/l.totalMs*r),i=Math.round(l.tail.durMs/l.totalMs*r),u=Math.max(1,r-s-i),c=s+u+i-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function Ex({currentTime:e,sources:t,index:a,audioDuration:r}){const l=a||0,s=Array.isArray(t)&&t.length>0?t[l]:void 0,i=s?s.duration||r||0:r||0;if(!(i>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/i))}function Dx({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:l,tailMs:s}){const i=Ec({durationsSec:[r],leadInMs:l,tailMs:s});return Ax(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Sx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return Nx(Ec({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function jx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Tx({ended:e,completedByEnd:t}){return!!e||!!t}function Mx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Lx(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function $x(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],l=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const i=s;l.push({code:i.code??null,src:i.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){l.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const i=String(s),u=a(i,t);u&&l.push({code:i,resolvedPath:u})}}return l}function Rx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Sc(a)!==Sc(t):!0}function Sc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const jc=4,Px=Br(jc/hs);function Ix(e){const{src:t,segments:a,progress:r=0,waveProgressRef:l,noiseSrc:s,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:m,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:b=0,trackDurationSec:x=0}=e,C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null),[A,y]=o.useState(!1),[w,v]=o.useState(null),[B,k]=o.useState(2),[E,D]=o.useState(0),[N,I]=o.useState(null),[P,K]=o.useState(!1),[T,M]=o.useState(!1),L=3,Q=3,H=1,O=300,U=o.useRef(0),$=o.useCallback(()=>{const ye=C.current,me=h&&h.current?h.current:ye?ye.closest(".audio-player__wave"):null,se=me?me.getBoundingClientRect():ye?ye.getBoundingClientRect():null,Ce=se?se.width:0,ge=se?Math.max(100,se.width):320,ce=se?se.height:0,Me=Math.max(H,Math.min(O,Math.floor((ge+Q)/(L+Q)))),Oe=Me*L,Le=Math.max(0,Me-1),ze=Math.max(0,Le>0?(ge-Oe)/Le:Q);return{bars:Me,gap:ze,height:ce,width:Ce}},[]),V=o.useRef(void 0),z=o.useRef(null),Y=o.useCallback(async(ye,me,{quiet:se=!1}={})=>{const Ce=++U.current,ge=()=>U.current===Ce;try{if(se||y(!1),V.current=ye,!ye){ge()&&g(null);return}let ce=me;if(!ce)try{for(let Le=0;Le<4&&!(C.current||h.current);Le++)await new Promise(ze=>requestAnimationFrame(ze));await new Promise(Le=>requestAnimationFrame(Le));const Oe=$();Oe.height>0&&D(Oe.height),ce=Oe.bars,k(Oe.gap)}catch{ce=120}z.current=ce;const Me=await Ac(ye,ce);if(!ge())return;if(!Me){g(null),y(!1);return}g(Me),v(ce),y(!0)}catch{if(!ge())return;g(null),y(!1)}},[y,g,D,k,v,$]);o.useEffect(()=>{const ye=h.current;if(!ye||typeof ResizeObserver>"u")return;let me=null;const se=new ResizeObserver(()=>{me!==null&&cancelAnimationFrame(me),me=requestAnimationFrame(()=>{me=null;try{const Ce=$();if(Ce.width<=0||(Ce.height>0&&D(Ce.height),z.current===null||Ce.bars===z.current))return;const ge=V.current;k(Ce.gap),ge?Y(ge,Ce.bars,{quiet:!0}).catch(()=>{}):z.current=Ce.bars}catch{}})});return se.observe(ye),()=>{se.disconnect(),me!==null&&cancelAnimationFrame(me)}},[$,Y]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;Y(typeof ye=="string"?ye:void 0).catch(()=>{}),M(!1)},[t,a,Y]),o.useEffect(()=>{let ye=!1;if(K(!1),I(null),!s||!w)return;const me=c>0?c*(u||1):void 0;return Ac(s,w,me,!0).then(se=>{ye||(I(se),se||K(!0))}).catch(()=>{ye||(I(null),K(!0))}),()=>{ye=!0}},[s,w,c,u]);const S=Math.max(0,Math.min(1,d)),R=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=w||40,Z=o.useMemo(()=>Sx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:b}),[F,x,f,b]),pe=o.useMemo(()=>Array.from({length:F}).map((ye,me)=>{const se=me>=Z.lead&&me<Z.lead+Z.sound,Ce=Z.sound>0&&se?Math.min(F-1,Math.round((me-Z.lead)/Z.sound*F)):-1,ge=se?_&&_[Ce]!=null?_[Ce]:null:_?0:null,ce=ge==null?null:Math.min(1,ge/R*S),Me=ce!=null&&E>0&&wr(ce)<=jc,Oe=ce==null?.15:Me?0:Br(ce),Le=Me,ze=F>1?me/(F-1):0;return n.jsx("div",{className:Le?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":Oe,"--i":me,"--mix":ze}},me)}),[F,_,R,S,E,Z]),re={"--progress":String(Math.max(0,Math.min(1,r)))},oe=o.useMemo(()=>N&&N.length&&Math.max(...N.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[N]),ne=S*Math.max(0,i),W=!s||!N||!N.length?1:Math.max(1,ne),ie={"--bar-gap":`${B}px`,"--wave-h":`${wr(W)}px`,"--wave-h1":`${hs}px`},q=A&&(s?!!N||P:!0);o.useEffect(()=>{q&&M(!0)},[q]);const G=T?A:q;o.useEffect(()=>{m?.(G)},[G,m]);const de=w||40,Ee=o.useMemo(()=>Array.from({length:de}).map((ye,me)=>{const se=N&&N[me]!=null?N[me]:null,Ce=se==null?0:Math.abs(se)/oe*ne,ge=Math.max(Px,Br(Ce)),ce=de>1?me/(de-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":ge,"--i":me,"--mix":ce}},me)}),[de,N,oe,ne,E]);return n.jsxs("div",{className:"audio-player__wave",ref:h,style:ie,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${q?"is-ready":""}`,"aria-hidden":"true",children:Ee}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${G?"is-ready":""}`,ref:C,children:pe}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${G?"is-ready":""}`,ref:l,style:re,children:pe})]})]})}const Tc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function fs(e,t){return new Promise((a,r)=>{const l=document.createElement("audio");let s=!1;const i=()=>{try{l.removeAttribute("src"),l.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(l.duration)&&l.duration||0;i(),a(d)},c=d=>{s||(s=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};l.addEventListener("loadedmetadata",u),l.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),l.src=e})}const Fx=2e3;function Mc(e,t=Fx){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.addEventListener("canplay",l,{once:!0}),e.addEventListener("error",l,{once:!0}),setTimeout(l,t)})}function Ox({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),l=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!l.current.length)return;const d=l.current;l.current=[];for(const m of d)m(!0)},[]),i=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(m),l.current=l.current.filter(f=>f!==d),c(p)},m=setTimeout(()=>d(!0),a);l.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=l.current;l.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:i}}function zx(){const e=o.useRef([]),t=o.useCallback(l=>(e.current.push(l),l),[]),a=o.useCallback(l=>{const s=new Set([...l].filter(Boolean));e.current=e.current.filter(i=>{if(s.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const l of e.current)try{URL.revokeObjectURL(l)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function Wx({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),l=o.useCallback(()=>r(null),[]),s=o.useCallback(()=>{try{const i=t.current?.getBoundingClientRect();if(!i)return;r({left:i.left,right:i.right,width:i.width,height:i.height,x:i.x,top:i.top+e,bottom:i.bottom+e,y:i.y+e,toJSON:i.toJSON.bind(i)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[a,l]),{ref:t,rect:a,show:s,hide:l}}function Hx(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const Vx=400,qx=2e3,Lc=5;function Ux({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:l,sequencer:s,leadInMs:i=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),m=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if($n){const h=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&h-x>Vx){const _=m.current===null||h-m.current>qx;if(m.current=h,_&&d.current<Lc){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(h-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",g>=Lc?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=h}try{const h=e.current,_=Array.isArray(r.current)?r.current[l.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:Hx(h),y=t.current,w=(i||0)>0||(u||0)>0,v=w&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{y&&y.style.visibility!=="hidden"&&(y.style.visibility="hidden")}catch{}else{const B=g?_.duration:A||0;$n&&v&&!(B>0)&&St("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const k=w?Dx({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,trackDurationSec:B,leadInMs:i||0,tailMs:u||0}):Ex({currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,sources:r.current,index:l.current,audioDuration:A??0});try{y&&(y.style.visibility&&(y.style.visibility=""),y.style.left=`${k*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(k))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,l,s,i,u]),b=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:b}}function Cs({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:l=!1,ttsText:s=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:m=0}){const{t:p}=xe.useTranslation(),f=e,b=xr(),x=o.useRef(b?.registerAnalyser);o.useEffect(()=>{x.current=b?.registerAnalyser});const C=o.useRef(null),h=o.useRef(null),_=o.useRef(null),g=zx(),A=o.useRef(null),y=o.useRef(!1),w=o.useRef(null),{ref:v,rect:B,show:k,hide:E}=Wx();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[I,P]=o.useState("idle"),[K,T]=o.useState("stopped"),M=o.useRef("stopped");o.useEffect(()=>{M.current=K},[K]);const[L,Q]=o.useState(0),[H,O]=o.useState("active"),U=o.useRef(!1);o.useEffect(()=>{if(H!=="playMode"||!U.current)return;U.current=!1;const X=typeof document<"u"?document.activeElement:null;if(X&&X!==document.body)return;const ue=_.current?.querySelectorAll("button")[1];try{ue?.focus()}catch{}},[H]);const[$,V]=o.useState(null),[z,Y]=o.useState(null),[S,R]=o.useState(0),[F,Z]=o.useState(!1),[pe,re]=o.useState(0),oe=b?.playbackRate??1,ne=b?.mainVolume??1,W=b?cs(b.settings):0,ie=b?Bc(b.settings):ne,[q,G]=o.useState("idle"),[de,Ee]=o.useState(""),[ye]=o.useState("top"),me=o.useRef(null),se=o.useRef(0),Ce=o.useRef(null),ge=o.useRef(!0),ce=dx({mountedRef:ge}),Me=o.useRef(null),Oe=o.useRef(d),Le=o.useRef(m);o.useEffect(()=>{Oe.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Le.current=Math.max(0,m||0)},[m]);const{start:ze,stop:We,settleTo:dt}=Ux({audioRef:C,fillRef:h,waveProgressRef:Ce,sourcesRef:me,currentIndexRef:se,sequencer:ce,leadInMs:d,tailMs:m}),{onReadyChange:lt,waitForReady:at,markNotReady:mt}=Ox({showSoundWaveForm:u,showNoiseWaveForm:c}),Ae=o.useRef(null),qe=o.useRef(l),we=o.useRef(r),Ue=o.useRef(null),ke=o.useRef(!1),[$e,je]=o.useState(!1),Ze=o.useCallback(X=>{ke.current=X,je(X)},[]),yt=o.useRef(null),{activeNoiseUrl:et,noiseSettingsRef:Xe,fadeInNoise:_t,fadeOutNoise:Ct}=bx({noisePlayer:b,audioRef:C,playbackStateRef:M,sequencer:ce}),{startTTS:wt,stopTTS:Bt}=yx({ttsText:s,playbackRate:oe,mainVolume:ie,fillRef:h,waveProgressRef:Ce,setProgress:Q,setPlaybackState:T,setStateLocal:O,fadeInNoise:_t,fadeOutNoise:Ct,noiseSettingsRef:Xe,onDoneRef:we,handleEndRef:yt});o.useEffect(()=>{it.current=Bt});const ht=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Ee(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}wt(X);return}Pe("tts"),wt(X)},rt=Array.isArray(t)?t.filter(Boolean):t?[t]:[],te=(!rt||rt.length===0)&&!!s,Ne=Array.isArray($)&&$.length>0?$:Array.isArray(z)&&z.length>0?z:null,Je=Math.max(Array.isArray(Ne)?Ne.length:0,rt.length);o.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const Ve=()=>{ce.abort()},it=o.useRef(null),Se=o.useRef(null),pt=o.useRef(null),gt=o.useRef(null);gt.current||(gt.current=()=>{pt.current=null;const X=C.current;if(Se.current==="audio"&&X&&(!X.paused||ce.isRunning())){Ve();try{X.pause()}catch{}ge.current&&(T("paused"),We(),Ct())}else if(Se.current==="tts")try{it.current?.()}catch{}});const Pe=X=>{Se.current=X,pt.current=dr(gt.current)},nt=()=>{pt.current?.(),pt.current=null};o.useEffect(()=>()=>{gt.current&&pr(gt.current)},[]);const vt=o.useRef(oe);o.useEffect(()=>{vt.current=oe||1},[oe]);const Ge=o.useCallback(X=>{const ue=vt.current||1;try{X.defaultPlaybackRate=ue}catch{}try{X.playbackRate=ue}catch{}},[]),ot=o.useCallback((X,ue)=>{if(!Rx(X,ue)){try{X.currentTime=0}catch{}Ge(X);return}X.src=ue,Ge(X),X.load(),Ge(X)},[Ge]),st=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),G("idle")},[]),ct=o.useCallback(async(X,ue=3,ee=50,ve=0)=>{st();const Re=ce.generation(),He=!!X&&X.currentTime>0&&!X.ended,tt=Math.max(0,Oe.current-Math.max(0,ve));if(tt>0&&!He){Pe("audio"),ze(),T("playing");const ft=Xe.current;if(ft?.enabled&&(ft.volume??0)>0)try{_t(ft.volume)}catch{}if(!await ce.waitPad(tt,"lead",ve)||!ge.current||!ce.isCurrent(Re))return!1}ce.enterSound();for(let ft=0;ft<ue;ft++){if(!ge.current||!ce.isCurrent(Re))return!1;try{return Pe("audio"),await X.play(),!0}catch(be){if((be instanceof Error||typeof be=="object"&&be&&"name"in be?be.name:void 0)==="AbortError"){if(!ce.isCurrent(Re))return!1;await new Promise(j=>setTimeout(j,ee));continue}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,ze,ce,_t,Xe,st]),kt=o.useCallback(X=>{const ue=ce.generation(),ee=Math.max(0,Le.current-Math.max(0,X));ze();const ve=Xe.current;if(ve?.enabled&&(ve.volume??0)>0)try{_t(ve.volume)}catch{}const Re=()=>{try{Me.current?.()}catch{}};if(ee<=0){ce.leave(),Re();return}ce.waitPad(ee,"tail",X).then(He=>{ce.leave(),He&&ce.isCurrent(ue)&&Re()}).catch(()=>{})},[ce,ze,_t,Xe]),Vt=o.useCallback(()=>{const X=C.current;if(!X)return;const ue=()=>{T("playing"),O("playMode"),Z(!0),ze();try{eo(),er(X).then(He=>{if(ge.current)try{x.current?.("main",He)}catch{}})}catch{}const Re=Xe.current;Re?.enabled&&(Re?.volume??0)>0&&_t(Re.volume)},ee=()=>{Tx({ended:!!X?.ended,completedByEnd:ke.current})||(T("paused"),We(),Ct())},ve=()=>{const Re=()=>{try{const He=me.current,tt=jx(He,se.current);if(tt!==null){se.current=tt,R(tt),Z(!0);const ft=He?.[tt]&&He[tt].src;if(ft&&X){ot(X,ft),ct(X).catch(()=>{});return}}}catch{}T("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}We(),Z(!1),Ct();try{!qe.current&&yt.current&&yt.current()}catch{}};if(Me.current=Re,Le.current>0){ze(),ce.waitPad(Le.current,"tail").then(He=>{ce.leave(),He&&Re()}).catch(()=>{});return}Re()};return X.addEventListener("play",ue),X.addEventListener("pause",ee),X.addEventListener("ended",ve),()=>{try{X.removeEventListener("play",ue),X.removeEventListener("pause",ee),X.removeEventListener("ended",ve),We()}catch{}}},[_t,Ct,ct,Xe,ze,We,ce]);o.useEffect(()=>Vt(),[Vt]),o.useEffect(()=>{qe.current=l},[l]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(l||H!=="active")return;const X=w.current;if(!X)return;let ue=null;const ee=requestAnimationFrame(()=>{try{const ve=X.getTotalLength();if(!ve)return;const Re=ve*.2;X.style.strokeDasharray=`${ve-Re} ${Re}`;const He="triFlow_"+Math.random().toString(36).slice(2);ue=document.createElement("style"),ue.textContent=`@keyframes ${He}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ve}}}`,document.head.appendChild(ue),X.style.animation=`${He} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ee),ue?.remove()}},[H,l]),o.useEffect(()=>{me.current=$},[$]),o.useEffect(()=>{se.current=S},[S]),o.useEffect(()=>{const X=_.current,ue=A.current;if(!X||!ue)return;let ee=null;const ve=32,Re=60,He=()=>{try{const ft=Array.from(X.querySelectorAll(":scope > .button"));let be=0;ft.forEach(Ie=>{if(Ie===ue)return;const Ye=Ie.getBoundingClientRect();be+=Ye.width});const j=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(j-be-8)),he=Je;if(!he||J<=0){Array.from(ue.children).forEach(Ie=>{try{Ie.style.width=""}catch{}});return}let De=Math.floor(J/he);De>Re&&(De=Re),De<ve&&(De=Math.max(ve,Math.floor(J/he))),Array.from(ue.querySelectorAll(".button")).forEach(Ie=>{try{Ie.style.width=`${De}px`}catch{}})}catch{}},tt=requestAnimationFrame(He);try{ee=new ResizeObserver(()=>{requestAnimationFrame(He)}),ee.observe(X),ee.observe(ue),window.addEventListener("resize",He)}catch{}return()=>{try{cancelAnimationFrame(tt)}catch{}try{ee&&(ee.disconnect(),ee=null)}catch{}try{window.removeEventListener("resize",He)}catch{}}},[$,z,Je]),o.useEffect(()=>()=>{try{Ae.current&&(clearTimeout(Ae.current),Ae.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const en=(X,ue)=>{V(X),re(ue),mt(),Y(Mx(X)),me.current=X},Cn=()=>{O("playMode"),R(0),Z(!0)},jn=async(X,ue)=>{Ze(!1),y.current=!1,ot(X,ue),await Mc(X),await at()!==!1&&(N(!1),Cn(),await ct(X))},Wn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await fs(X,{timeoutMs:1e4,rejectOnError:!0});en([{src:X,objectUrl:null,duration:ve}],ve),P("ready"),ue&&ee&&await jn(ee,X)}finally{y.current=!1,N(!1)}},Hn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await Promise.all(X.map(He=>fs(He,{timeoutMs:1e4})));if(!ge.current)return;const Re=X.map((He,tt)=>({src:He,objectUrl:null,duration:ve[tt]||0}));en(Re,Lx(Re)),P("ready"),ue&&ee&&Re.length>0&&await jn(ee,Re[0].src)}finally{y.current=!1,N(!1)}},qt=async(X=!1,ue=!0)=>{const ee=C.current,ve=t?Array.isArray(t)?t:[t]:[];if(!ve||ve.length===0||!ve.some(Boolean))return!1;if(y.current)return null;y.current=!0,ue&&N(!0),P("resolving");try{const Re=$x(t,a,yl),He=[];let tt=0;for(const ft of Re){let be=ft.src??null,j=null;if(!be&&ft.resolvedPath){try{P("getting_signed_url"),be=await vl(ft.resolvedPath)}catch{be=null}if(!ge.current)return!1;if(!be)try{P("downloading");const he=await xl(ft.resolvedPath);if(!ge.current)return!1;if(he){const De=he instanceof Blob?he:new Blob([he]);j=g.track(URL.createObjectURL(De)),be=j}}catch{P("error");try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),O("active")}catch{}}}if(!be)continue;let J=0;try{P("measuring_duration"),J=await fs(be,{timeoutMs:3e3})}catch{J=0}if(!ge.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const he of He)if(he.objectUrl)try{URL.revokeObjectURL(he.objectUrl)}catch{}return!1}tt+=J||0,He.push({...ft,src:be,objectUrl:j,duration:J})}if(en(He,tt),He.length>0&&X&&ee){const ft=He[0];Ze(!1);try{g.keepOnly(He.map(be=>be.objectUrl))}catch{}if(P("ready"),y.current=!1,ft.src&&ee)try{if(ot(ee,ft.src),await Mc(ee),await at()===!1)return!1;ue&&N(!1),Cn(),ee&&await ct(ee)}catch{ue&&N(!1)}else ue&&N(!1);O("playMode"),R(0),Z(!0)}return He.length>0}finally{y.current=!1,ue&&N(!1),P(Re=>Re==="ready"?"ready":"idle")}},dn=async X=>{const ue=ce.isRunning();if(X.paused&&!ue){if(ke.current){await Lt();return}const ee=ce.resume();if(ee){if(T("playing"),ee.phase==="tail"){kt(ee.elapsed);return}await ct(X,3,50,ee.elapsed);return}await ct(X),T("playing")}else ce.pause(),Ve(),X.pause(),T("paused"),ue&&(We(),Ct())},Ut=async()=>{const X=C.current;if(!(!X&&!te)){if(te){const ue=window.speechSynthesis;if(H==="active"){const ee=Na(),ve=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ee&&ve.length>0){if(y.current)return;O("load"),N(!0),P("synthesizing"),y.current=!0;try{const Re=await Promise.all(ve.map(He=>Promise.resolve(ee(He))));Re.length>1?await Hn(Re,!0):await Wn(Re[0],!0)}catch{y.current=!1,N(!1),O("active"),ht(ve.length>0?ve:void 0)}return}ht(ve.length>0?ve:void 0);return}if(H==="playMode"){const ee=!!ue&&(ue.speaking||ue.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!ee){await dn(X);return}try{if(ue&&ue.paused)try{Pe("tts"),ue.resume(),T("playing")}catch{}else try{ue.pause(),T("paused")}catch{}}catch{}}return}if(H==="active"){if(l&&Array.isArray(me.current)&&me.current.length>0){const ee=me.current[0];try{if(ee.src&&X)try{ot(X,ee.src),Cn(),X&&await ct(X)}catch{}Cn();return}catch{}}O("load");let ue;try{ue=await qt(!0)}catch{ue=!1}if(ue===!1&&ge.current){try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}O("active")}return}if(H!=="load"&&(H==="playMode"||H==="active"))try{X&&await dn(X)}catch(ue){(ue instanceof Error||typeof ue=="object"&&ue&&"name"in ue)&&ue.name}}},Lt=async()=>{const X=C.current;if(X)try{const ue=me.current;if(Array.isArray(ue)&&ue.length>1){await Ft(0);return}Ze(!1);try{X.currentTime=0}catch{}X&&await ct(X),T("playing"),O("playMode")}catch{}},Tn=()=>{Ve(),nt(),it.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}Ct(),T("stopped"),O("active"),Q(0),Z(!1)},ln=async(X,{sameSegment:ue=!1}={})=>{Ve();const ee=ce.generation(),ve=C.current,Re=me.current?.[X]?.src;try{if(Ze(!1),R(X),Z(!0),se.current=X,!Re||!ve||(ue||mt(),ot(ve,Re),!ue&&await at()===!1)||!ce.isCurrent(ee)||(await ct(ve),!ce.isCurrent(ee)))return;T("playing"),O("playMode")}catch{}},Mn=async()=>{const X=me.current,ue=se.current||0;if(!X||ue<=0){await Lt();return}await ln(ue-1)},Ln=async()=>{const X=me.current,ue=se.current||0;if(!X||ue>=X.length-1){Tn();return}await ln(ue+1)},xn=()=>{if(ke.current)return;const X=200,ue=340;Ze(!0),Ve(),nt();try{Q(1)}catch{}dt(1);try{G("hold")}catch{}try{const ee=C.current,ve=te&&!!ee?.src;if(!te||ve){if(ee){ee.pause();try{ee.currentTime=0}catch{}}}else Bt();Ct()}catch{}try{T("stopped")}catch{}if(Z(!1),!qe.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{G("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{G("idle")}catch{}Ue.current=null},ue)},X)}catch{}};o.useEffect(()=>{yt.current=xn});const Gt=o.useCallback(()=>Ee(""),[]),Ft=async X=>{(me.current||[])[X]&&await ln(X,{sameSegment:X===se.current})},$t=K==="playing",pn=o.useMemo(()=>{if(!z||z.length<=1)return z;const X=z[S];return X?[X]:z},[z,S]),Ot=l===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Ge(X)}catch{}},[oe,Ge]);const tn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ue=Math.max(0,Math.min(1,ie)),ee=tn.current,ve=()=>{ee.raf!==null&&(cancelAnimationFrame(ee.raf),ee.raf=null),ee.timer!==null&&(clearTimeout(ee.timer),ee.timer=null)};ve();const Re=tr(X);if(X.paused||Math.abs(Re-ue)<.001||typeof requestAnimationFrame!="function"){try{In(X,ue)}catch{}return}const He=performance.now(),tt=()=>{const ft=Math.min(1,(performance.now()-He)/150);try{In(X,Re+(ue-Re)*ft)}catch{}ee.raf=ft<1?requestAnimationFrame(tt):null};return ee.raf=requestAnimationFrame(tt),ee.timer=setTimeout(()=>{ve();try{In(X,ue)}catch{}},200),ve},[ie]);const Tt=q==="hold",Kt=q==="out",le=H==="playMode"&&!D&&!$e||Tt||Kt,Be=K!=="stopped"||Tt||Kt,Te=K==="paused",Ke=Math.max(0,Math.min(100,(L||0)*100)),Fe=_e("audio-player__fill",le?"is-visible":"",Be?"is-expanded":"",Te?"is-paused":"",Kt?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${$t?"is-playing":""} ${D?"is-loading":""} ${H!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Tc[I]?"status":void 0,"aria-live":Tc[I]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p("training.audioStatus.preparing",{defaultValue:"\uC18C\uB9AC\uB97C \uC900\uBE44\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026"})})]}):null,H==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{U.current=Cr(),E(),Ut()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:k,onMouseLeave:E,onFocus:k,onBlur:E,children:n.jsx("span",{ref:v,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:w,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,B&&n.jsx(wn,{anchorRect:B,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${H==="playMode"||$t?"is-visible":""}`,inert:!(H==="playMode"||$t)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:Mn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:$t?"pause":"play",onClick:Ut,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":$t,width:"60px",variant:"transparent-white",disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Tn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),Je>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:Je}).map((X,ue)=>n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ue+1),onClick:()=>{try{Ft(ue)}catch{}},ariaLabel:p("training.sourcePlay",{n:ue+1}),variant:"transparent-white",selected:F&&S===ue,disabled:H!=="playMode"||!(Array.isArray($)&&$[ue]),showTooltipInfo:!0},ue))}):null,!Array.isArray($)||$.length<=1?n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Lt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"}):null,n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Ln,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:xn,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Fe,ref:h,style:{left:`${Ke}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(Ix,{segments:pn,progress:L,totalDuration:pe,waveProgressRef:Ce,showSoundWaveForm:u,leadInMs:d,tailMs:m,trackDurationSec:$?.[S]?.duration??0,noiseSrc:c&&b?.settings.enabled&&W>0?et:null,noiseRatio:b?Ja(b.settings):0,noiseSpeed:b?.settings.speed??1,mainVolume:ne,onReadyChange:lt})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(Qe,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(ha,{message:de,position:ye,onClose:Gt})]})}function kr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:l=null,onClose:s,closeOnOutsideClick:i=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:m,decrease:p,canIncrease:f,canDecrease:b,fontSize:x,lineHeight:C}=Mi({storageKey:"tooltip-fontScale"}),h=o.useCallback(()=>d(w=>w==="dark"?"light":"dark"),[]),_=o.useCallback(w=>{try{w.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},y=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((w,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:w})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__buttons",children:[n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!b}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:m,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!f}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:h,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return l?n.jsx(hn,{anchorRect:l,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:y}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:y})}function $c({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(Qe,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Rc(e,t,a){const r=o.useRef(t),l=o.useRef(a);o.useEffect(()=>{r.current=t,l.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,i=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(gn)).find(m=>!m.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=l.current();if(d)try{d.focus()}catch{}}}},[e])}function Pc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:l=!1,onPreviewTextBtn:s,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:m=!1}){const{t:p}=xe.useTranslation(),f=un("(max-width: 767px)"),b=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[h,_]=o.useState(!1),[g,A]=o.useState(null),[y,w]=o.useState(null);Rc(h&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const B=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(D=>typeof D=="string"||typeof D=="number")?i.join(""):"",[i]),k=o.useCallback(()=>{_(!1),A(null),w(null)},[]);o.useEffect(()=>{if(!h)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){k();return}w(typeof D<"u"&&D!==null?D:null)},[B]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(w(typeof D<"u"&&D!==null?D:i),!C.current){_(N=>!N);return}if(h)_(!1),A(null),w(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,i,h]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:b,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),l||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:m,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||m,onDisabledClick:m&&r!=="disabled"?()=>{}:void 0}),l&&n.jsx("div",{ref:C,children:n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:h?"is-selected":void 0,"aria-expanded":h,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof s!="function"})})]}),h&&n.jsx(kr,{text:y??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:k,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function gs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function ea({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:l={},children:s,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(()=>gs(e,t));o.useEffect(()=>{const v=gs(e,t);if(v!==p){const B=setTimeout(()=>f(v),0);return()=>clearTimeout(B)}},[e,t,p]);const b=o.useCallback((...v)=>{gs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[h,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const B=v;if(typeof v=="object"&&(B.currentTarget||B.target)&&(B.nativeEvent||B.type)){const D=B.currentTarget??B.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const k=v;if(k&&typeof k.getBoundingClientRect=="function")return k.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:B="",label:k="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const I=g(v);_({text:B,label:k,anchorRect:I,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),y=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),w=o.Children.map(s,v=>{if(o.isValidElement(v)){const B=v;if(typeof B.type=="string")return B;const k=B.props??{},E=typeof k.onDone=="function"?k.onDone:b,D=typeof k.disabled=="boolean";let N=p==="disabled";return D&&(N=!!k.disabled),o.cloneElement(B,{onDone:E,disabled:N,showTooltip:A,hideTooltip:y})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx($c,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Pc,{state:p,title:r,...l,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),w]}),x?n.jsx(hn,{anchorRect:h.anchorRect,backdrop:h.backdrop,onClose:y,ariaLabel:m("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(kr,{text:h.text,onClose:y})}):null]})}function Ic({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[l,s]=o.useState("disabled"),[i,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",i)}catch{}},[i]);const c=()=>u(P=>P==="dark"?"light":"dark"),{increase:d,decrease:m,canIncrease:p,canDecrease:f,fontSize:b,lineHeight:x}=Mi({storageKey:"textbox_fontScale"}),[C,h]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=Cr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),y=o.useCallback(()=>h(""),[]),w=P=>{try{h(P)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const P=setTimeout(()=>s(t),0);return()=>clearTimeout(P)}},[t]);const B=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[k,E]=o.useState(B);k!==B&&(E(B),s("disabled"));const D=t==="disabled"?l:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",I=o.useMemo(()=>({fontSize:`${b}px`,lineHeight:`${x}px`}),[b,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const P=document.activeElement;P&&P!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&i==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(fe,{htmlType:"button",size:48,type:"bar",onClick:A,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:I,children:B})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:m,onDisabledClick:()=>w(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>w(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:i==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:i==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(ha,{message:C,position:"top",onClose:y})]})}function ta(e){return e==="active"||e==="done"}function bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,useTitleFaded:s,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:m,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:b=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:h}=xe.useTranslation(),_=l??h("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",y=Array.isArray(m)&&m.length?m:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,w=d?d.join("||"):"",v=m?m.join("||"):"",[B,k]=o.useState(()=>Array.isArray(y)?C?Ta(y):y.slice():void 0);o.useEffect(()=>{Array.isArray(y)&&y.length?k(C?Ta(y):y.slice()):k(void 0)},[c,w,v,C]);const[E,D]=o.useState(null),[N,I]=o.useState(()=>new Set);o.useEffect(()=>{D(null),I(new Set)},[v,c,w]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&(D(null),I(new Set)),P.current=t},[t,e]);const K=o.useCallback(M=>{if(!ta(A))return;const L=B?.[M];if(L==null)return;const Q=L;if(p){const H=new Set(N);H.has(Q)?H.delete(Q):H.add(Q),I(H),typeof u=="function"&&u({selectedValues:[...H],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...H],__ts:Date.now()})}else D(Q),typeof u=="function"&&u({selectedIndex:M,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:M,selectedValue:Q,__ts:Date.now()})},[B,A,p,u,N]),T=`training-step__buttons${Array.isArray(B)&&B.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:T,children:Array.isArray(B)&&B.length>0?B.map((M,L)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>K(L),ariaLabel:String(M),label:M,useLabel:!0,icon:x?x[String(M)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(M):E===M,useDisabledCovered:b,minWidth:0},String(M))):null})})}function ys({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),m=l??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",b=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,h]=o.useState(c??null),_=`${String(b)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&h(null));const[y,w]=o.useState(c);Object.is(y,c)||(w(c),h(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&h(null),v.current=t},[t,e,c]);const B=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof i=="function"&&i(N),ta(f)&&typeof s=="function"&&s(N)},[i,f,s]),k=o.useCallback(()=>{ta(f)&&(h(!1),B(!1))},[B,f]),E=o.useCallback(()=>{ta(f)&&(h(!0),B(!0))},[B,f]);return n.jsxs(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:m,onDone:s,useTitleFaded:!1,children:[n.jsx(Ic,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>{ta(f)&&(h(N),B&&B(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:k,disabled:f==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:E,disabled:f==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function vs({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:l,btnLabel:s,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:m,disabled:p,_pageIndex:f,showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:h}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,title:g,onDone:l,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:m},children:n.jsx(Cs,{soundSrc:i,ttsText:i?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:h},`audio-p${f??0}-s${e}`)})}const Gx=[];function xs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=Gx}){const{t:c}=xe.useTranslation(),d=l??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),m=Y=>typeof Y=="string"?Y:Y&&(Y.context||Y.sentence||Y.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[b,x]=o.useState(()=>(p||[]).map((Y,S)=>({id:S,text:m(Y)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),h=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const Y=Array.isArray(u)?u:[];f(Y);const S=(R=>{const F=(R||[]).map((oe,ne)=>({id:ne,text:m(oe)}));if(F.length<=1)return F;const Z=(oe,ne)=>{if(oe.length!==ne.length)return!1;for(let W=0;W<oe.length;W++)if(oe[W].text!==ne[W].text)return!1;return!0};let pe=Ta(F),re=0;for(;Z(pe,F)&&re<20;)pe=Ta(F),re+=1;return pe})(Y);x(S);try{if(typeof i=="function"){const R=S.filter((F,Z)=>F.text===m(Y[Z])).length;i({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const R=S.filter((F,Z)=>F.text===m(Y[Z])).length;g.current=u,s({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const Y=Array.isArray(u)?u:[],S=b.filter((R,F)=>R.text===m(Y[F])).length;s({shuffled:b,score:S,total:Y.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(Y,S)=>{const R=[...b],F=Y+S;if(F<0||F>=R.length)return;const Z=R[F];R[F]=R[Y],R[Y]=Z,Q(R);try{if(typeof s=="function"&&C==="active"){const pe=R.filter((re,oe)=>re.text===m(p[oe])).length;s({shuffled:R,score:pe,total:(p||[]).length,__ts:Date.now()})}}catch{}},[y,w]=o.useState(null),v=o.useRef(null),B=o.useRef(null),k=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),I=o.useRef(null),P=o.useRef({dx:0,dy:0}),K=()=>{if(I.current!==null)return;const Y=()=>{if(!v.current){I.current=null;return}I.current=requestAnimationFrame(Y);const S=N.current,R=P.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-R.dx}px, ${S.y-R.dy}px, 0)`)};I.current=requestAnimationFrame(Y)},T=o.useRef(new Map),M=o.useRef(new Map),L=()=>{const Y=new Map;return T.current.forEach((S,R)=>{S&&S.getBoundingClientRect&&Y.set(R,S.getBoundingClientRect())}),Y},Q=Y=>{const S=L();x(Y);try{if(typeof i=="function"){const R=Y.filter((F,Z)=>F.text===m(p[Z])).length;i({shuffled:Y,score:R,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const R=L();Y.forEach(F=>{const Z=S.get(F.id),pe=R.get(F.id),re=T.current.get(F.id);if(!re||!Z||!pe)return;const oe=Z.top-pe.top;oe&&(re.style.transition="none",re.style.transform=`translateY(${oe}px)`,requestAnimationFrame(()=>{re.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",re.style.transform="";const ne=()=>{re.style.transition="",re.removeEventListener("transitionend",ne)};re.addEventListener("transitionend",ne)}))})})},H=(Y,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(Y))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const R=document.createElement("div");R.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(R),S.dataTransfer?.setDragImage(R,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(R)}catch{}})}catch{}}catch{}w(Y);try{const R=b[Y],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=R&&R.text?R.text:"",document.body.appendChild(F),v.current=F;const Z=T.current.get(R.id);let pe=S.clientX||0,re=S.clientY||0;try{if(Z&&Z.getBoundingClientRect){const G=Z.getBoundingClientRect();pe=G.left+G.width/2,re=G.top+G.height/2}}catch{}const oe=F.getBoundingClientRect(),ne=oe.width/2,W=oe.height/2;P.current={dx:ne,dy:W},F.style.transition="none",N.current={x:pe,y:re},F.style.transform=`translate3d(${pe-ne}px, ${re-W}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}K()});const ie=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};k.current=ie,document.addEventListener("mousemove",ie);const q=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};B.current=q,document.addEventListener("dragover",q);try{S.dataTransfer?.setData("text/plain",String(Y));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:Y}))}catch{}}catch{}}catch{}},O=(Y,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const R=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(R&&E.current!==R){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{R.classList.add("drag-over")}catch{}E.current=R}}catch{}},U=(Y,S)=>{S.preventDefault();const R=S.dataTransfer?.getData("text/plain")||"",F=R?parseInt(R,10):y,Z=Y;if(typeof F!="number"||isNaN(F)||F===Z){w(null),z(),$();return}const pe=CC(b,F,Z);Q(pe),w(null),$();try{if(typeof s=="function"&&C==="active"){const re=pe.filter((oe,ne)=>oe.text===m(p[ne])).length;s({shuffled:pe,score:re,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const re=document.querySelectorAll(".order-list .order-list__item")[Z];if(!re)return;const oe=re.querySelector(".order-list__slot")||re;try{oe.classList.add("pulse"),oe.offsetHeight,oe.classList.add("to-dark");const ne=()=>{oe.classList.remove("pulse","to-dark"),oe.removeEventListener("transitionend",ne)};oe.addEventListener("transitionend",ne)}catch{}})}catch{}z()},$=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}B.current&&(document.removeEventListener("dragover",B.current),B.current=null),k.current&&(document.removeEventListener("mousemove",k.current),k.current=null),I.current!==null&&(cancelAnimationFrame(I.current),I.current=null)},V=()=>{w(null),z(),$()};o.useEffect(()=>()=>$(),[]);const z=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(Y=>Y.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const Y=Math.max(1,(b||[]).length);b.forEach((S,R)=>{const F=M.current.get(S.id);if(!F)return;let Z=50;Y>1&&(Z=Math.round(R/(Y-1)*100));try{F.style.setProperty("--marker-pos",Z+"%")}catch{}})}catch{}},[b]),o.useEffect(()=>()=>{$(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:b.map((Y,S)=>{const R=Math.max(1,(b||[]).length),F=R>1?Math.round(S/(R-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":F+"%"},ref:Z=>{const pe=M.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:Z=>{const pe=T.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},className:`order-list__draggable ${y===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:h,onDragStart:h?Z=>H(S,Z):void 0,onDragEnter:h?Z=>O(S,Z):void 0,onDragOver:h?Z=>O(S,Z):void 0,onDragLeave:h?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const Z=document.querySelectorAll(".order-list .order-list__item");Z&&Z[S]&&(Z[S].classList.remove("drag-over"),E.current===Z[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:h?Z=>U(S,Z):void 0,onDragEnd:h?V:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:Y.text}),h?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===b.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},Y.id)})})})}const Kx=8e3;function Yx(e,t){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.then(l,l),setTimeout(l,t)})}function Fc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:m=!1,maxCards:p,playAllGapMs:f=0}){const{t:b}=xe.useTranslation(),x=l??b("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),h=p??3,_=(C||[]).slice(0,h);(C||[]).length>h&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${h} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[y,w]=o.useState(null),v=o.useRef([]),[B,k]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{w(null)},[N]);const I=o.useRef(void 0);o.useEffect(()=>{const L=I.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&w(null),I.current=t},[t,e]);const P=o.useCallback((L,Q)=>{if(c)return;const H={item:L,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(A==="active"&&typeof s=="function")try{s(H)}catch{}},[c,i,A,s]),K=o.useRef(f);o.useEffect(()=>{K.current=Math.max(0,f||0)},[f]);const T=o.useCallback(async()=>{if(B||A==="disabled")return;k(!0);let L=!1;const Q=new Promise(H=>{E.current=()=>{L=!0,H()}});try{for(let H=0;H<_.length&&!(!D.current||L);H++){const O=v.current[H];if(!O)continue;await Promise.race([Yx(O.play(),Kx),Q]);const U=Math.max(0,K.current||0);U>0&&H<_.length-1&&!L&&D.current&&await Promise.race([new Promise($=>{setTimeout($,U)}),Q])}}finally{E.current=null,k(!1)}},[B,A,_.length]),M=o.useCallback((L,Q)=>{if(!ta(A))return;w(Q);const H={selectedValue:L.word||L.title||"",selectedIndex:Q,item:L,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(typeof s=="function")try{s(H)}catch{}},[i,A,s]);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!m&&_.length>0,onPlayAll:T,playAllActive:B},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Q=E.current;if(!Q)return;const H=L.target;H&&typeof H.closest=="function"&&H.closest(".training-word-card__bottom")&&Q()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:b("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((L,Q)=>n.jsx(Jo,{ref:H=>{v.current[Q]=H},item:L,disabled:A==="disabled",onPlayDone:()=>P(L,Q),selectable:c,selected:c&&y===Q,onSelect:c?()=>M(L,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:m},L&&L.id||Q))})})}const Zx=160,Oc=()=>{};function Dn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:y,children:w,align:v="horizontal",icon:B,useFullWidth:k=!1}=e,E=D=>{y&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),y())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",k?"panel-row--label-fixed panel-row--fill":"",y?"panel-row--clickable":""),onClick:y,onKeyDown:y?E:void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[B!=null&&n.jsx("div",{className:"panel-row__icon",children:B}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:w})]})}if(e.variant==="description")return n.jsx("div",{className:"panel-row panel-row--block",children:n.jsx("p",{className:"panel-row__description body-3",children:e.children})});if(e.variant==="empty")return n.jsx("div",{className:"panel-row panel-row--empty body-3",children:e.children});if(e.variant==="loading")return n.jsx("div",{className:"panel-row panel-row--loading",children:n.jsx(Ga,{size:28})});if(e.variant==="custom"&&!e.label)return n.jsx("div",{className:"panel-row panel-row--block",children:e.children});const{variant:a,label:r,sub:l,onClick:s,required:i,error:u,align:c="horizontal",useFullWidth:d=!1,icon:m}=e,p=a==="button"?void 0:s;let f=null;const b=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(vu,{checked:g.checked,onChange:g.onChange,id:b})}else if(a==="segmented"){const g=e;f=n.jsx(bn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((y,w)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(cn,{options:y.options,value:y.value,onChange:y.onChange,placeholder:y.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:y.ariaLabel??([r,y.placeholder].filter(Boolean).join(" ")||void 0)})},w))}):n.jsx(cn,{options:g.options??[],value:g.value??"",onChange:g.onChange??Oc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,y)=>n.jsx(fe,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},y))}):f=n.jsx(fe,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??Oc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:i,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const h=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",h?"panel-row--label-fixed":"",a==="text"?"panel-row--text":"",p?"panel-row--clickable":""),onClick:p,onKeyDown:p?_:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,children:[m!=null&&n.jsx("div",{className:"panel-row__icon",children:m}),n.jsxs("div",{className:"panel-row__left",children:[b?n.jsxs("label",{htmlFor:b,className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}):n.jsxs("div",{className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}),l&&n.jsx("div",{className:"panel-row__sub caption-1",children:l})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function zc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function Xx({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:l}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const i=e[s],u=s==="left"?r("device.direction.left","\uC88C"):r("device.direction.right","\uC6B0");return n.jsxs("div",{className:"panel-row__device-column",children:[n.jsxs("div",{className:"panel-row__device-head",children:[n.jsx("span",{className:"panel-row__device-side body-2b",children:u}),i&&t&&n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"x",ariaLabel:`${u} ${r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C")}`,showTooltipInfo:r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"),onClick:()=>t(s)})]}),i?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[i.device&&n.jsx(Et,{size:"small",variant:Ou(i.device),fill:"soft",label:zu(i.device,r)}),zc(i)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:zc(i)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:i.productName||i.brand}),Yo(i.wornYear,i.wornMonth,i.wornDay,l.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Yo(i.wornYear,i.wornMonth,i.wornDay,l.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Ar({title:e,titleLevel:t=2,icon:a,disc:r,actions:l,size:s="medium",minHeight:i,maxWidth:u,className:c,scrollable:d,scrollbarGutter:m="auto",compactRows:p=!1,useBorder:f=!0,useBg:b=!0,useRowBorder:x=!0,labelWidth:C,form:h=!1,loading:_,empty:g,children:A}){const y=_e("panel",`panel--${s}`,h?"panel--form":"",i!==void 0?"panel--fill":"",f?"":"panel--no-border",b?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),w={};i!==void 0&&(w.minHeight=i),u!==void 0&&(w.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(w["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:y,style:Object.keys(w).length?w:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(Qe,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),l&&n.jsx("div",{className:"panel__actions",children:l})]}),_?n.jsx(Dn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Dn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",m==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function Jx({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:l,style:s,children:i}){const u=o.useRef(null),[c,d]=o.useState();o.useEffect(()=>{const p=u.current;if(r===void 0||!p||(d(p.clientWidth),typeof ResizeObserver>"u"))return;const f=new ResizeObserver(([b])=>d(b.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const m=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",l),style:{"--panel-grid-cols":m?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:i})}function Qx(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Wc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}Qx(Rt.t.bind(Rt)),Wc(Rt.t.bind(Rt));const Nr="none",e_=.5,t_=1.5,n_=.25;function _s({title:e,valueLabel:t,value:a,min:r,max:l,step:s,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(Dn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Lu,{value:a,onChange:d,min:r,max:l,step:s,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function Hc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),l=un("(max-width: 767px)")?40:24,s=xr(),i=Ja(s?.settings??Qn),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,m=s?.mainVolume??1,p=Math.round(m*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),b=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Xa,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===Nr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),h=[{key:Nr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Wc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(hn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__header",children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Ar,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(_s,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:l,onChange:f}),n.jsx(_s,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:e_,max:t_,step:n_,size:l,onChange:b}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Dn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(bn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:h,value:c?u:Nr,onChange:C})}),n.jsx(_s,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:Xa,step:_c,size:l,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Dn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(bn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:h,value:Nr,onChange:()=>{}})})})]})})}function Vc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:l=0,stepCount:s=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(!1),[b,x]=o.useState(null),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=xr(),y=u>0,w=y&&i<u-1,v=!y||i>=u-1,B=l===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const k=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=_?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=g?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),N=un("(max-width: 767px)"),I=o.useRef(null),[P,K]=o.useState(null),T=o.useCallback(()=>{h(Q=>{const H=!Q;return K(H?I.current?.getBoundingClientRect()??null:null),H})},[]),M=o.useCallback(()=>{h(!1),K(null)},[]);o.useEffect(()=>{c&&(h(!1),K(null))},[c]);const L=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(Uo,{analyser:A?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.noise","\uC18C\uC74C")}),n.jsx(Uo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.noise","\uC18C\uC74C")})]})]});return Rc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.current].map(Q=>Q?.querySelector("button")??null).find(Q=>!!Q&&Q.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:E,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:I,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:T,selected:C,"aria-expanded":N?C:void 0,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:L})]}),e&&C&&N&&P&&n.jsx(hn,{anchorRect:P,onClose:M,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:L})}),n.jsxs("div",{className:"pp-bottom__right",children:[v&&n.jsx(fe,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!B}),w&&n.jsx(fe,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!B})]}),e&&p&&n.jsx(Hc,{anchorRect:b,onClose:k,hideNoiseRows:d})]})}function qc({title:e,subtitle:t,desc:a,depth:r,icon:l,wrapperStyle:s,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:m,onBack:p,onClose:f}){const{t:b}=xe.useTranslation(),x=un("(max-width: 767px)"),C=Number.isInteger(m)?m:u||0,h=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,y=typeof t=="string"?t.trim():t,w=!!(A||y),v=w?A||y:b("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),B=g||(A?t:void 0),k=x&&typeof B=="string"&&(B.includes(" \xB7 ")||B.includes(" / "))?B.split(/\s[·/]\s/).pop():B,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(fe,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:b("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:l?n.jsx(du,{icon:l,label:e,tooltip:i,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[k?n.jsx("span",{className:"pp-title__depth caption-1",children:k}):null,n.jsx("span",{className:`pp-title__title h2${w?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Iu,{max:Math.max(0,h??0),index:Math.max(0,C??0)})]})}function a_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function r_(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const Uc=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Gc(e,t,a){const r=e,l=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=ql().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:l,label:r?.title||l,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Uc(`topic.${s.key}`,s.label):void 0,i?Uc(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function ws(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Kc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,l=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(l).toISOString()}:{}}}function o_(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function s_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:l=[],emptyMessage:s,buildResults:i,metaPatch:u}){const c=Gc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},m=t?.id||t?.title||l.length;return{id:`${e}:${m}`,meta:{...c,...d},pages:l,emptyMessage:s,buildResults:i}}function l_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function i_(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function u_(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function Yc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function c_(e,t,a,r){return Yc(e,t*a+r)}function d_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const l=e;if(Array.isArray(l.selectedValues))return r.every(s=>l.selectedValues.includes(s))&&l.selectedValues.every(s=>r.includes(s));if(typeof l.correct=="boolean")return l.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(l=>String(l)===String(a[t]));if(typeof t<"u")return r.some(l=>String(l)===String(t))}}function p_(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const Zc=o.createContext(null);function m_(){const e=o.useContext(Zc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function h_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,choices:s=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),b=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[b]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const h=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!ta(m))return;const y=p;let w;if(y[A]!=null){const B=y[A];w=y.map(k=>k!==null&&k>=B?null:k)}else w=[...y],w[A]=h;f(w);const v={selectedOrder:w,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(y[A]==null&&w.length>0&&w.every(B=>B!==null))try{typeof i=="function"&&i(v)}catch{}},[m,p,h,u,i,s]),g=l??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,y)=>n.jsx(Jo,{item:{word:A},disabled:m==="disabled",selectable:!0,selected:p[y]!==null,orderRank:p[y],onSelect:()=>_(y),flipDelay:y*120,hideLabel:!1,hideAudio:!0},`${A}-${y}`))})})}function Er(e){return null}Er.__isTrainingPage=!0;function xa(e,t){const a=m_();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function Xc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i}=xa(e,t);return n.jsx(vs,{...a,index:r,stepIndex:l,isLast:s,onDone:i})}function Jc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(bs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function Qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(ys,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function ed({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(xs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function td({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(Fc,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function f_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(h_,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}const nd=3e4,C_=/^(https?:|blob:|data:audio|\/|\.\/)/;function ad(e){return typeof e=="string"&&C_.test(e)?e:null}const g_=e=>typeof e=="string"&&e.trim()!==""?e:null,Bs=Symbol("timed-out");function b_(e,t){if(t<=0)return Promise.resolve(Bs);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(Bs),t)})]).finally(()=>clearTimeout(a))}function y_(e){return e?Na()||Xr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function v_(e,t){const a=[],r=ad(t);r&&a.push({kind:"raw",resolve:async()=>r});const l=(e??"").trim();if(!l)return a;for(const[s,i]of[["urlResolver",Na()],["fallbackUrlResolver",Xr()]])i&&a.push({kind:s,resolve:async u=>{let c;try{c=await b_(i(l),u)}catch(m){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,m),null}return c===Bs?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${nd}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):g_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function x_(){return Date.now()+nd}const __=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function w_(e){St("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Dr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const l of r){if(typeof l=="string"&&l.trim().length)return l.trim();if(typeof l=="number"||typeof l=="boolean")return String(l)}}}return null}function B_(e){return Dr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function k_(e){return ad(Dr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function rd(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Dr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function od(e){const{score:t,contextsLength:a,results:r=[],subtitle:l,onReplay:s,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),m=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=rd(D),I=Dr(D?.wording,D?.label);return N===!0?{variant:"main",label:I??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:I??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:I??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),b=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),h=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{h.current?.(),h.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const y=o.useRef(0),w=(D,N)=>{if(!$n)return;const I=Math.round(performance.now()-y.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${I}ms ${D}`,N??"")},v=o.useRef(0),B=o.useCallback((D,N,I)=>{A();const P=++v.current,K=()=>v.current===P;y.current=$n?performance.now():0,w(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:I}),g(D),h.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Yr()};const T=H=>{w("\uD2BC\uB2E4",H);const O=mr(H,U=>{w(`\uB05D\uB0AC\uB2E4 \u2014 ${U?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:K()}),U&&K()&&(h.current=null,g(null))});return h.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,O.stop(),Yr()},O.done},M=v_(N,I);w("\uCC28\uB840",M.map(H=>H.kind));const L=M[0]?.kind==="raw",Q=L?T(I):Promise.resolve(!1);(async()=>{if(await Q||!K())return;const H=x_(),O=L?M.slice(1):M;for(let U=0;U<O.length;U++){if(!K())return;w(`${O[U].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const $=await O[U].resolve(__(H,O.length-U));if(w(`${O[U].kind} \uAC00 \uB2F5\uD588\uB2E4`,$),!K()||$&&(await T($)||!K()))return}K()&&(w("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),w_(N),h.current=()=>{v.current++,Yr()},w("\uB0AD\uB3C5\uD55C\uB2E4"),kf(N,{onEnd:()=>{K()&&(h.current=null,g(null))}}))})()},[A]),k=o.useMemo(()=>C.map(D=>{const N=D??{},I=B_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:P,label:K}=f(N),T=Array.isArray(N.corrects)?N.corrects:[],M=T.length?T.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,L=typeof N.selectedText=="string"?N.selectedText:null,Q=rd(N)===!0,H=k_(N),O=!!H||y_(I);return{problem:I,variant:P,label:K,answer:M,selectedText:L,isCorrect:Q,sound:H,canHear:O}}),[C,f,d]),E=o.useMemo(()=>k.some(D=>D.answer!==null||D.selectedText!==null),[k]);return n.jsx(On,{onClose:i,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:D,closeWithAnimation:N})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:m,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>D(s)}),n.jsx(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?m:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),l&&n.jsx("p",{className:"trp-result__subtitle body-3",children:l}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:b}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:b})]})})]}),k.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),E&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),k.map((D,N)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(fe,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():B(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(Et,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const ks=new Set;function A_(e){o.useEffect(()=>{if(!e||ks.has(e))return;ks.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,l=0,s=0;const i=()=>{const m=Date.now();a==null&&(a=m),r==null&&(r=m)},u=()=>{r!=null&&(l+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const m=l-s;if(m<1e3||s===0&&l<5e3)return;const p=Date.now(),f=p-m;s=l,yC({trainingType:e,startedAt:new Date(f).toISOString(),endedAt:new Date(p).toISOString()})},d=()=>{t()?i():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),ks.delete(e)}},[e])}function Sr(e,t){return e&&e.id||`page-${t??0}`}function jr(e,t){return e&&e.key||`step-${t??0}`}function Tr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function N_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const E_=300,D_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Sn=Object.freeze({}),sd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function As(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,l=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?l:null,total:r}}const S_=e=>n.jsx(od,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function j_(e){const{scenario:t,title:a,subTitle:r,depth:l,icon:s,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:m,stepCount:p,onBack:f,onComplete:b,onRoundFinished:x,onNext:C,onSettings:h,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:y,buildResults:w,onResult:v,typeKey:B,entryPoint:k,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:I,hideNoiseRows:P=!1}=e;A_(B&&!sd.has(B)?B:"");const K=o.useRef(0);o.useEffect(()=>{K.current=Date.now()},[]);const{t:T}=xe.useTranslation(),M=v,L=!!t,Q=t?.id||null,H=t?.meta||{},O=Array.isArray(t?.pages)?t.pages:[],U=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],$=U.length>0,V=le=>le===Er||le?.__isTrainingPage===!0,z=$&&U.some(le=>V(le.type)),Y=z?U.filter(le=>V(le.type)).map((le,Be)=>{const Te=le.props||{};return{id:`children-page-${Be}`,steps:o.Children.toArray(Te.children).filter(o.isValidElement),pageTop:Te.pageTop||Te.top||null,pageBottom:Te.pageBottom||Te.bottom||null}}):[{id:"children-page-0",steps:U}],S=$&&!L&&typeof g!="function",R=S?Math.max(1,Y.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const le=document.body;return le.dataset.ihabTrainingPopupCount=String(Number(le.dataset.ihabTrainingPopupCount||"0")+1),le.classList.add("ihab-training-popup-open"),()=>{const Be=Number(le.dataset.ihabTrainingPopupCount||"1")-1;Be>0?le.dataset.ihabTrainingPopupCount=String(Be):(delete le.dataset.ihabTrainingPopupCount,le.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return Q2()},[]);const[F,Z]=o.useState({...Qn,enabled:!1}),pe=o.useRef(F);o.useEffect(()=>{pe.current=F},[F]);const re=o.useRef(I),oe=o.useRef(!1),ne=o.useRef(null);o.useEffect(()=>{let le=!1;const Be=Te=>{if(le)return;oe.current=!0;const Ke=Te?Jn({...Qn,enabled:!1},Te):{...Qn},Fe=ne.current;ne.current=null;const X=Fe?Jn(Ke,Fe):Ke;pe.current=X,Z(X),Fe&&!re.current&&uo(X),rr(X);const ue=re.current;if(ue){const ee=typeof ue=="function"?ue(X):ue,ve=Jn(X,ee);pe.current=ve,Z(ve),rr(ve)}};return SC().then(Te=>{if(le){const Ke=ne.current;if(ne.current=null,Ke&&!re.current){const Fe=Te?Jn({...Qn,enabled:!1},Te):{...Qn};uo(Jn(Fe,Ke))}return}Be(Te)}),()=>{le=!0}},[]);const[W,ie]=o.useState(null),[q,G]=o.useState(null),de=o.useCallback((le,Be)=>{le==="main"?ie(Be):G(Be)},[]),Ee=o.useRef(null),ye=o.useRef(null),me=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const le=Ee.current;Ee.current=null,le&&uo(le)},[]);o.useEffect(()=>{if(typeof window>"u")return;const le=()=>{document.visibilityState==="hidden"&&me()};return window.addEventListener("pagehide",me),document.addEventListener("visibilitychange",le),()=>{window.removeEventListener("pagehide",me),document.removeEventListener("visibilitychange",le),me()}},[me]);const se=o.useCallback(le=>{const Be=Jn(pe.current,le);if(pe.current=Be,Z(Be),!oe.current){ne.current={...ne.current??{},...le},rr(Be);return}re.current||(Ee.current=Be,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(me,E_)),rr(Be)},[me]),Ce=F.mainSpeed,ge=F.mainVolume,ce=o.useCallback(le=>se({mainSpeed:le}),[se]),Me=o.useCallback(le=>se({mainVolume:le}),[se]),Oe=o.useMemo(()=>({settings:F,setSettings:se,registerAnalyser:de,mainAnalyser:W,noiseAnalyser:q,playbackRate:Ce,setPlaybackRate:ce,mainVolume:ge,setMainVolume:Me}),[F,se,de,W,q,Ce,ce,ge,Me]),Le=o.useRef(null),[ze,We]=o.useState(0),dt=o.useRef([]),[lt,at]=o.useState("center"),[mt,Ae]=o.useState(!1),qe=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(le=>{qe.current||(qe.current=!0,Ae(!0),we.current=setTimeout(()=>{try{le()}catch{qe.current=!1,Ae(!1)}},D_()?0:Zx))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const ke=o.useRef(f);o.useEffect(()=>{ke.current=f});const $e=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const le=Le.current,Be=$e.current;if(fo(le,Be),le){const Te=Array.from(le.querySelectorAll(gn)).filter(Ke=>!Ke.closest('[aria-hidden="true"]'))[0];if(Te)try{Te.focus()}catch{}}return()=>{const Te=document.activeElement;if(!Te||Te===document.body||le&&le.contains(Te))try{Co(Be)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const le=ke.current;typeof le=="function"&&le()})),[Ue]),mo(Le,!0);const[je,Ze]=o.useState(!1),yt=o.useRef(!1),[et,Xe]=o.useState(null),_t=o.useRef(0),Ct=o.useRef(0),wt=()=>{_t.current+=1,Ct.current+=1,Xe(null)},[Bt,ht]=o.useState(""),[rt,te]=o.useState(()=>Tr()),Ne=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(te(Tr()),wt())},[L,Q,S]),o.useEffect(()=>{S&&te(le=>{const Be=Math.max(0,Math.min(le.pageIndex,Math.max(0,R-1)));return Be!==le.pageIndex?{...le,pageIndex:Be,stepIndex:0}:le})},[S,R]);const Je=S?Math.max(0,Math.min(rt.pageIndex,R-1)):0,Ve=S?Y[Je]:null,it=S&&Ve&&Array.isArray(Ve.steps)?Ve.steps:[],Se=L?rt.pageIndex:S?Je:typeof c=="number"?c:0,pt=L?O[Math.max(0,Math.min(rt.pageIndex,Math.max(0,O.length-1)))]:null,gt=L&&pt&&Array.isArray(pt.steps)?pt.steps:[],Pe=L?gt.length:S?it.length:typeof p=="number"?p:0,nt=L||S?Math.max(0,Math.min(rt.stepIndex,Math.max(0,Pe))):typeof m=="number"?m:0,vt=L?O.length:S?R:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const le=L?Sr(pt,Se):Ve?.id||`children-page-${Se??0}`,Be=new Date().toISOString();for(let Te=0;Te<=nt;Te+=1){const Ke=L?jr(gt[Te],Te):`step-${Te}`,Fe=ct(le,Ke);st.current.has(Fe)||st.current.set(Fe,Be)}},[L,S,Se,nt,Ve?.id]),o.useLayoutEffect(()=>{const le=Ne.current;if(typeof Se=="number"&&le!==null&&Se!==le&&Se>le)try{ht(T("training.problemNotice",{n:Se+1}))}catch{}Ne.current=typeof Se=="number"?Se:Ne.current},[Se,c,T]),o.useLayoutEffect(()=>{const le=Le.current;if(!le)return;const Be=()=>le.querySelector(".page-popup__scroll");let Te=null,Ke=null,Fe=null;const X=He=>{const tt=Be();if(!tt)return;const ft=tt.scrollHeight<=tt.clientHeight;if(at(ft?"center":"top"),He&&!yt.current){yt.current=!0;try{Ze(!0)}catch{}try{ve.disconnect()}catch{}}},ue=()=>{Te!==null&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Ke!==null&&clearTimeout(Ke),Ke=setTimeout(()=>X(!0),60)})},ee=()=>{Fe!==null&&cancelAnimationFrame(Fe),Fe=requestAnimationFrame(()=>X(!1))};ue(),window.addEventListener("resize",ee);const ve=new MutationObserver(ue);ve.observe(le,{childList:!0,subtree:!0,attributes:!0});const Re=setTimeout(()=>{yt.current||X(!0)},400);return()=>{window.removeEventListener("resize",ee),Te!==null&&cancelAnimationFrame(Te),Ke!==null&&clearTimeout(Ke),Fe!==null&&cancelAnimationFrame(Fe),clearTimeout(Re);try{ve.disconnect()}catch{}}},[Le]);const Ge=o.useCallback(le=>{Le.current&&(Le.current._childOnNext=le)},[]),ot=o.useCallback(le=>{Le.current&&(Le.current._childOnResult=le)},[]),st=o.useRef(new Map),ct=(le,Be)=>`${le}\0${Be}`,kt=o.useCallback((le,Be,Te)=>{te(Ke=>{const Fe=Ke.answersByPage[le]||{},X=Fe[Be],ue=ws(Te),ee=ws(X);if(X&&ee>ue)return Ke;const ve=Kc(Te,st.current.get(ct(le,Be)),ue);return{...Ke,answersByPage:{...Ke.answersByPage,[le]:{...Fe,[Be]:ve}}}})},[te]),Vt=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te)},[pt,Se,kt]),en=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te),!Te?.allowChange&&le?.autoAdvance!==!1&&te(X=>({...X,stepIndex:Math.max(X.stepIndex,Be+1)}))},[pt,Se,kt,te]),Cn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=typeof Be=="number"?Be:nt??0,Fe=`step-${Ke}`;kt(Te,Fe,le),le?.allowChange||te(X=>({...X,stepIndex:Math.max(X.stepIndex,Ke+1)}))},[Ve,Se,nt,kt,te]),jn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=`step-${typeof Be=="number"?Be:nt??0}`;kt(Te,Ke,le)},[Ve,Se,nt,kt]),Wn=S?{currentPageIndex:Se??0,currentStepIndex:nt??0,totalStepsInPage:it.length,handleStepDone:Cn,handleStepChange:jn}:null,Hn=async()=>{const le=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:O,flowState:rt,answersByPage:rt.answersByPage})):null;return typeof M=="function"&&await Promise.resolve(M(le))||le},qt=async()=>{const le=Ve?.id||`children-page-${rt.pageIndex}`,Be=rt.answersByPage[le]||{},Te=z?(()=>{const X={};let ue=0;return Y.forEach(ee=>{const ve=rt.answersByPage[ee.id]||{},Re=Array.isArray(ee.steps)?ee.steps.length:0;for(let He=0;He<Re;He+=1){const tt=ve[`step-${He}`];typeof tt<"u"&&(X[`step-${ue+He}`]=tt)}ue+=Re}),X})():Be;if(typeof w=="function"){const X=await Promise.resolve(w(Te,{pageAnswers:Be,answersByPage:rt.answersByPage,pages:Y,currentPageId:le}));return typeof M=="function"&&await Promise.resolve(M(X))||X}const Ke=Object.entries(Be).map(([X,ue],ee)=>({index:ee,key:X,payload:ue})),Fe={results:Ke,answers:Ke,score:0};return typeof M=="function"&&await Promise.resolve(M(Fe))||Fe},dn=()=>{const le=++_t.current,Be=()=>le!==_t.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if(L){const Fe=Hn();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}if(S){const Fe=qt();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}const Te=Le.current&&Le.current._childOnResult,Ke=Fe=>{try{return Fe?Fe():void 0}catch{return}};if(typeof Te=="function"){const Fe=Ke(Te);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{ue&&!Be()?Xe(ue):X()}).catch(ue=>{X()});return}if(typeof M=="function"){const Fe=Ke(M);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}ue&&!Be()?Xe(ue):X()}).catch(ue=>{console.error("viewResults external handler failed",ue),X()});return}},Ut=()=>{if(L){if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){te(Be=>({...Be,pageIndex:Be.pageIndex+1,stepIndex:0}));return}return dn()}if(S){const Be=it.length;if(typeof nt=="number"&&nt<Be-1){te(Te=>({...Te,stepIndex:Te.stepIndex+1}));return}if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){te(Te=>({...Te,pageIndex:Te.pageIndex+1,stepIndex:0}));return}return dn()}if(typeof C=="function"){try{C()}catch{}return}const le=Le.current&&Le.current._childOnNext;if(typeof le=="function"){try{le()}catch{}return}},Lt=L?H.title||H.label||A||T("common.popup","\uD31D\uC5C5"):a||y||(Array.isArray(l)?l[l.length-1]:void 0)||A||T("common.popup","\uD31D\uC5C5"),Tn=A||Lt,ln=L?H.title??H.label??Lt:a??y??Lt,Mn=(le,Be)=>{const Te=Sr(pt,Se),Ke=jr(le,Be),Fe=rt.answersByPage[Te]?.[Ke],X=N_(le,{page:pt,pageIndex:Se,step:le,stepIndex:Be,storedPayload:Fe,answersByPage:rt.answersByPage,flowState:rt}),ue={key:Ke,index:Be,stepIndex:nt,isLast:Be===gt.length-1};switch(le?.type){case"listen":return n.jsx(vs,{...ue,...X,onDone:ee=>en(le,Be,ee)});case"confirm":return n.jsx(bs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"confirmWithText":return n.jsx(ys,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"orderList":return n.jsx(xs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});default:return null}},Ln=o.useRef(void 0);o.useEffect(()=>{const le=Ln.current;if(Ln.current=Se,le===void 0||le===Se||!Cr())return;const Be=Le.current;if(!Be)return;const Te=document.activeElement;if(!(!Te||Te===document.body||!Be.contains(Te)||Te.disabled===!0))return;const Ke=Be.querySelector(`.training-steps ${gn.split(", ").join(", .training-steps ")}`)??Array.from(Be.querySelectorAll(gn)).find(Fe=>!Fe.closest('[aria-hidden="true"]'));try{Ke?.focus()}catch{}},[Se]);const xn=L?O.length>0?n.jsx("div",{className:"training-steps",children:gt.map((le,Be)=>Mn(le,Be))},`replay-${ze}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||T("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Gt=S?n.jsxs(Zc.Provider,{value:Wn,children:[Ve?.pageTop?n.jsx("div",{className:"training-page-top",children:Ve.pageTop}):null,n.jsx("div",{className:"training-steps",children:it.map((le,Be)=>{const Te=le;return o.cloneElement(Te,{...Te.props,_stepIndex:Be,_totalSteps:it.length,_stepKey:`step-${Be}`,_pageIndex:Se})})},`replay-${ze}`),Ve?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Ve.pageBottom}):null]}):null,Ft=o.useRef(-1),$t=o.useCallback(()=>{if(!B)return;const le=et,{results:Be,correct:Te,total:Ke}=As(et),Fe={correct:Te,total:Ke,attempt:dt.current.length+1,previousAttempts:[...dt.current]};if(Ft.current===Ct.current)return Fe;Ft.current=Ct.current,vC({items:DC(Be),category:sd.has(B)?"sentence":"word",trainingType:B,entryPoint:k??"sentence",itemRef:D??null,correct:Te,total:Ke,score:typeof le?.score=="number"?le.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-K.current)/1e3)),dailyTotal:E??null});try{x?.(Fe)}catch{}return Fe},[B,k,E,D,et,x]);o.useEffect(()=>{!et||et===Sn||et?.isEmpty||(As(et).total??0)>0&&$t()},[et,$t]);const pn=o.useCallback(()=>{const le=$t();wt(),Ue(()=>{typeof b=="function"&&b(le),typeof f=="function"&&f()})},[b,f,$t,Xe,Ue]),Ot=o.useCallback(()=>ht(""),[ht]),tn=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),Tt=n.jsxs("div",{className:`page-popup${mt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Tn,children:[n.jsxs("div",{ref:Le,className:`page-popup__panel ${je?"":"page-popup__panel--measuring"} ${lt==="center"?"page-popup__panel--center":lt==="top"?"page-popup__panel--top":""}`,children:[n.jsx(qc,{title:ln,subtitle:L?H.subtitle||H.label:Array.isArray(l)?l.join(" / "):void 0,desc:L?void 0:r,depth:L?H.depth:l,icon:L?H.icon:s,wrapperStyle:L?H.wrapperStyle:i,iconTooltip:L?H.iconTooltip:u,progressMax:vt,progressIndex:Se,pageIndex:Se,pageCount:vt,onBack:tn,onClose:tn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${lt==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Gt:L?xn:typeof g=="function"?g({registerOnNext:Ge,registerOnResult:ot,panelRef:Le,setResultOverlay:Xe}):g})}),n.jsx(Vc,{onSettings:h,onNext:Ut,onResult:dn,useNoiseSettingBtn:!!(L?H.useNoiseSetting??!0:_),stepIndex:nt,stepCount:Pe,pageIndex:Se,pageCount:vt,resultOpen:!!(et&&!et.isEmpty),hideNoiseRows:P})]}),et&&!et.isEmpty&&(N??S_)({score:et.score,results:et.results||et.answers||[],contextsLength:et.results?et.results.length:et.answers?et.answers.length:0,onReplay:()=>{if(K.current=Date.now(),et!==Sn){const{correct:le,total:Be}=As(et);dt.current.push({correct:le,total:Be})}if(wt(),We(le=>le+1),L){if(te(Tr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){te(Tr());return}try{const le=Le.current&&Le.current._childOnResult;typeof le=="function"&&le({replay:!0})}catch{}},onClose:pn,pending:et===Sn}),et?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(fe,{htmlType:"button",variant:"main",size:48,onClick:pn,label:T("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ha,{message:Bt,position:"top",onClose:Ot})]}),Kt=n.jsx(ps.Provider,{value:Oe,children:Tt});return typeof document<"u"&&document.body?nn.createPortal(Kt,document.body):Kt}const zn=j_;zn.Page=Er,zn.ListenStep=Xc,zn.ConfirmStep=Jc,zn.ConfirmWithTextStep=Qc,zn.OrderListStep=ed,zn.CardStep=td,zn.CardOrderStep=f_;function T_({label:e,homonum:t}){const a=sa()?.(e,t)??"",{imgRef:r,loading:l,hasImage:s,onLoad:i,onError:u}=Xo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[l&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:l?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function ld({words:e,anchorRect:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),l({left:c,top:d})},[t]),!t||e.length===0?null:nn.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(T_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function M_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:l,groups:s,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:m,onPrintEmpty:p,className:f,emptyHint:b,sectionType:x="page",disc:C}){const{t:h,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:y,close:w}=Pa(),[v,B]=o.useState(null),k=o.useCallback(()=>{w(),B(null)},[w]);Ey(k,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,I=r===void 0&&t===void 0,P=N?"match":I?"original":"ganada",[K,T]=o.useState(()=>P),[M,L]=o.useState("50"),[Q,H]=o.useState(1),[O,U]=o.useState(N);O!==N&&(U(N),T(P));const $=K==="match"&&!N||K==="original"&&!I?P:K,V=o.useMemo(()=>[...N?[{value:"match",label:h("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...I?[{value:"original",label:h("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:h("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:h("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:h("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:h("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:h("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:h("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[h,N,I]),z=o.useMemo(()=>["10","25","50","100"].map(se=>({value:se,label:h("wordSearch.pageSize",{count:Number(se),defaultValue:`${se}\uAC1C\uC529 \uBCF4\uAE30`})})),[h]),Y=se=>se.words?.[0],S=o.useMemo(()=>{const se=[...D].length,Ce=nC(D),ge=new Map;return ce=>{let Me=ge.get(ce);return Me===void 0&&(Me=Ce((ce.words?.[0]?.label??"").slice(0,se))?0:1,ge.set(ce,Me)),Me}},[D]),R=o.useCallback((se,Ce)=>{const ge=Oe=>Y(Oe)?.label??"",ce=Oe=>Y(Oe)?.syllables??[...ge(Oe)].length,Me=Oe=>(Oe.words??[]).reduce((Le,ze)=>{const We=parseInt(ze.grade??"",10);return Number.isFinite(We)&&We<Le?We:Le},999);switch($){case"match":return S(se)-S(Ce)||on(ge(se),ge(Ce));case"ganada":return on(ge(se),ge(Ce));case"ganada_desc":return on(ge(Ce),ge(se));case"syllable":return ce(se)-ce(Ce)||on(ge(se),ge(Ce));case"syllable_desc":return ce(Ce)-ce(se)||on(ge(se),ge(Ce));case"grade":return Me(se)-Me(Ce)||on(ge(se),ge(Ce));case"grade_desc":return Me(Ce)-Me(se)||on(ge(se),ge(Ce));default:return 0}},[$,S]),F=o.useMemo(()=>l.slice().sort(R),[l,R]),Z=Number(M)||10,pe=o.useMemo(()=>(s??[]).flatMap(se=>se.items.slice().sort(R).map(Ce=>({item:Ce,label:se.label}))),[s,R]),re=s?pe.length:F.length,oe=Math.max(1,Math.ceil(re/Z)),ne=Math.min(Q,oe),W=o.useMemo(()=>F.slice((ne-1)*Z,ne*Z),[F,ne,Z]),ie=o.useId(),q=o.useMemo(()=>{if(!s)return null;const se=pe.slice((ne-1)*Z,ne*Z),Ce=new Map;for(const{item:ge,label:ce}of se)Ce.has(ce)||Ce.set(ce,[]),Ce.get(ce).push(ge);return[...Ce.entries()].map(([ge,ce])=>({label:ge,items:ce}))},[s,pe,ne,Z]);o.useEffect(()=>{H(1)},[K,M,re,r]);const G=re>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(cn,{size:40,options:V,value:$,onChange:T,ariaLabel:h("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(cn,{size:40,options:z,value:M,onChange:L,ariaLabel:h("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(hr,{page:ne,totalPages:oe,onChange:H})]}):void 0,de=se=>{u&&u(se)},Ee=t!==void 0&&a?n.jsxs(n.Fragment,{children:[h("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),h("wordSearch.resultTitleSuffix",{unit:g?mC(a):a})]}):void 0,ye=t!==void 0&&t>0&&c!==void 0&&a?h("wordSearch.resultDisc",{unit:g?fC(a):a,max:c,selected:i.length}):void 0,me=C??ye;return n.jsxs(Ca,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(Ee||G||me)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(Qe,{icon:e,className:"word-search-result-block__head-icon"}),Ee&&n.jsx("span",{className:"word-search-result-block__title h3",children:Ee})]}),G&&n.jsx("div",{className:"word-search-result-block__head-actions",children:G}),me&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:me})]}),(s?s.length===0:l.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:h("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),b&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:b})]}),s?(q??[]).map(se=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${ie}-${se.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${ie}-${se.label}`,children:se.label}),n.jsx("div",{className:"word-search-result-block__items",children:se.items.map(Ce=>{const ge=i.includes(Ce.id);return n.jsx("div",{onMouseEnter:ce=>{y(ce.currentTarget),B(Ce.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(Ce.words??[]).map(ce=>ce.label),subLabel:(Ce.words??[]).some(ce=>ce.subLabel)?(Ce.words??[]).map(ce=>ce.subLabel):void 0,selected:ge,onClick:()=>de(Ce.id),minWidth:200})},Ce.id)})})]},se.label)):n.jsx("div",{className:"word-search-result-block__items",children:W.map(se=>{const Ce=i.includes(se.id);return n.jsx("div",{onMouseEnter:ge=>{y(ge.currentTarget),B(se.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(se.words??[]).map(ge=>ge.label),subLabel:(se.words??[]).some(ge=>ge.subLabel)?(se.words??[]).map(ge=>ge.subLabel):void 0,selected:Ce,onClick:()=>de(se.id),minWidth:200})},se.id)})}),v&&A&&n.jsx(ld,{words:v,anchorRect:A})]}),oe>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(hr,{page:ne,totalPages:oe,onChange:H})}),(d||m)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:h("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:i.length===0,onClick:i.length===0?void 0:d}),m&&n.jsx("div",{onClick:i.length===0?p:void 0,children:n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:h("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:m})})]})]})}function L_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,l=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:l}})}function $_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:l=4,minCount:s=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:m,title:p,titleIcon:f,disc:b,showInfoButton:x=!0,onClearPhoneme:C,onSearch:h,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:y=!1,pairMode:w=!1,sectionType:v="page",beforeSearchContent:B,beforeContent:k,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:I}=xe.useTranslation(),P=o.useMemo(()=>I("wordPairs.infoNotes",{returnObjects:!0}),[I]),K=o.useMemo(()=>Array.from({length:l-s+1},(S,R)=>{const F=s+R;return{key:String(F),label:I("wordPairs.count",{n:F})}}),[I,l,s]),T=o.useMemo(()=>I("wordPairs.ordinals",{returnObjects:!0}),[I]),M=o.useCallback(S=>N?I("wordPairs.phonemeOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeSingleLabel","\uC74C\uC808"):I("wordPairs.phonemeN",{n:S}),[N,T,a,I]),L=o.useCallback(S=>N?I("wordPairs.phonemeContrastOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):I("wordPairs.phonemeContrast",{n:S}),[N,T,a,I]),Q=o.useCallback((S,R)=>R?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:H,toggleAt:O,close:U}=Pa(),$=o.useCallback(S=>r(Number(S)),[r]),V=un("(max-width: 767px)"),z=o.useCallback(S=>L_(S,e).map(({label:R,value:F,displayLabel:Z})=>{const pe=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"phoneme-select-block__cell-jamo-part--empty",pe?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),pe&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:Z??R})]},R)}),[e,d]),Y=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:V?"dot":void 0,icon:"info",label:V?void 0:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:H?"is-selected":void 0,"aria-expanded":!!H,"aria-haspopup":"dialog",onClick:S=>O(S.currentTarget)})}),H&&n.jsx(Kn,{title:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:P,anchorRect:H,onClose:U})]});return n.jsxs(Ca,{type:v,title:p,icon:f,disc:b,action:x?Y:void 0,className:_e("phoneme-select-block",m),children:[k,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(bn,{options:K,value:String(a),onChange:$,size:40,ariaLabel:I("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:w?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:I("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(R+1)})]},R)})})]}):t.map((S,R)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:w?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2]??{};return n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(F,R*2):i,selected:F,onSelect:c?.(R*2),align:"newline"},R)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsx(En,{title:L(R+1),sections:u?u(F,R*2+1):i,selected:F,onSelect:c?.(R*2+1),align:"newline"},R)})})]}):t.map((S,R)=>n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(S,R):i,selected:S,onSelect:c?.(R),align:"newline"},R))})}),B&&n.jsx("div",{className:"phoneme-select-block__before-search",children:B}),(C||h||y)&&(()=>{const S=t.every(R=>{const F=Jf(R);return Object.entries(F).every(([Z,pe])=>!pe||Z==="coda"&&pe===jl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:I("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),h?n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:y?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||y,onDisabledClick:y?()=>{}:void 0,"aria-busy":y||void 0,onClick:h}):y?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function R_({title:e,sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:m}){const{t:p}=xe.useTranslation();return n.jsx(En,{className:m,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function P_({title:e,headerAction:t,sections:a,selected:r,onSelect:l,className:s}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(En,{className:s,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:l,align:"newline"})}function I_({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:l,positionCount:s,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:m}=xe.useTranslation(),p={searchMode:m("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:m("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:m("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:m("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:m("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:m("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:m("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:m("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:m("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:m("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:m("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=h=>m("wordPairs.count",{n:h}),b=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ha,{title:m("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[m("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),m("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),m("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Ha,{items:m("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ha,{title:m("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[m("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),m("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(h,_)=>{_===p.searchMode?a(h===p.explicit?"explicit":h===p.pick?"pick":"include"):_===p.phonemeOrder?l(h===p.orderMatch?"ordered":"unordered"):_===p.count?i(h===f(2)?2:1):_===p.inputMode&&c(h===p.pronInput?"phoneme":"word")};return n.jsx(En,{className:d,title:e??m("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:b,selected:x,onSelect:C,align:"inline"})}function F_(e){const{title:t,items:a,columns:r,resizeStorageKey:l,gridTemplateColumns:s,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:m=!0,selectedId:p,selectedIds:f,onSelect:b,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:h,emptyText:_,noMatchText:g,countLabel:A,topContent:y,className:w=""}=e,{t:v}=xe.useTranslation(),B=u??v("common.search","\uAC80\uC0C9"),k=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[I,P]=o.useState(d??r[0]?.key??""),[K,T]=o.useState(m),[M,L]=o.useState(String(h??C[0]??10)),[Q,H]=o.useState(1);o.useEffect(()=>{H(1)},[D,M]);const O=c!==null,U=o.useCallback((re,oe)=>{if(!oe)return!0;const ne=oe.toLowerCase();return r.some(W=>{const ie=re[W.key];return ie==null?!1:String(ie).toLowerCase().includes(ne)})},[r]),$=c??U,V=o.useMemo(()=>{const re=O?a.filter(oe=>$(oe,D)):a;return I?[...re].sort((oe,ne)=>{const W=oe[I],ie=ne[I];return W===ie?0:Bo(W,ie,K)}):re},[a,D,I,K,O,$]),z=Math.max(1,Math.ceil(V.length/Number(M)));Q>z&&H(z);const Y=Math.min(Q,z),S=V.slice((Y-1)*Number(M),Y*Number(M)),R=o.useCallback(re=>{I===re?T(oe=>!oe):(P(re),T(!0)),H(1)},[I]),F=o.useMemo(()=>{if(typeof A=="function"){const re=V.length,oe=A(re);if(typeof oe=="string"){const ne=oe.lastIndexOf(String(re));if(ne>=0)return{prefix:oe.slice(0,ne),suffix:oe.slice(ne+String(re).length)}}return{label:oe}}if(typeof A=="string"&&A.includes("{n}")){const[re,oe]=A.split("{n}");return{prefix:re,suffix:oe}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,V.length,v]),Z=o.useMemo(()=>r.map(re=>({label:re.label,onClick:re.sortable!==!1?()=>R(re.key):void 0,className:re.className,sortDir:re.sortable!==!1&&I===re.key?K?"asc":"desc":null})),[r,I,K,R]),pe=o.useMemo(()=>C.map(re=>({value:String(re),label:v("common.pageSizeLabel",{n:re})})),[C,v]);return n.jsxs(On,{className:`popup-list ${w}`,title:t,onClose:x,children:[y,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(Po,{count:"label"in F?void 0:{value:V.length,prefix:F.prefix,suffix:F.suffix},search:O?{value:D,onChange:N,placeholder:B}:void 0,pageSize:{options:pe,value:M,onChange:L},pagination:{page:Y,total:z,onChange:H}}),n.jsx(Ko,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:l,fields:Z,items:S,onRowClick:b,renderRow:re=>{const oe=f!=null?re.id!=null&&f.has(re.id):p!=null&&re.id===p;return r.map(ne=>({content:ne.render?ne.render(re):re[ne.key]??"",className:_e(ne.className,oe&&"popup-list__row--selected")}))},empty:O&&D!==""&&a.length>0?E:k})]})}function id(e){const{title:t,message:a,topContent:r,details:l,children:s,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:m="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:b=!0,onClose:x,inline:C,size:h="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),y=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=y.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),I=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];I&&!I.disabled&&I.focus()},[]);const w=o.useRef(!1),[v,B]=o.useState(!1),k=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(w.current)return;w.current=!0;const N=typeof document<"u"?document.activeElement:null;B(!0);let I=!1;try{I=await D()}catch(P){typeof console<"u"&&console.error(P)}finally{I||(w.current=!1,B(!1),requestAnimationFrame(()=>{const P=document.activeElement;(!P||P===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(On,{title:t,onClose:x,closeDisabled:v,inline:C,size:h,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);await d.onClick(N.close);const I=d.closeOnClick??!0;return I&&D(),I||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:i??A("common.confirm","\uD655\uC778"),variant:m,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);return await f(N.close),b&&D(),b||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),l&&l.length>0&&n.jsx(Ar,{children:l.map((D,N)=>n.jsx(Dn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:y,className:"body-2 confirm-popup__message",children:a}),s]})}function O_(e,t,a={}){const{t:r}=xe.useTranslation(),[l,s]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(s(!0),!1):!0,[e]),d=l?n.jsx(id,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function z_({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(""),[s,i]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),m=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async x=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),x()}catch(h){c($l(h)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),b=x=>{l(x.target.value),c(null)};return n.jsx(On,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?m:void 0,"aria-describedby":u?m:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:b,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:m,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const ud=["var(--color-main)","var(--color-sub)"],W_=2e3;function H_(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function Ns({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:l,trigger:s=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),h=t-C,_=(g,A)=>Array.from({length:g}).map((y,w)=>{const v=6+Math.random()*12,B=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),k=ud[Math.floor(Math.random()*ud.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,I=Math.cos(N)*D,P=Math.sin(N)*D*1.35,K=Math.random()*720-360,T=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),M=Math.random()>.7?"50%":"3px";return{id:`${A}-${w}`,side:A,size:B,color:k,delay:E,vx:I,vy:P,angularVel:K,life:T,borderRadius:M}});return[..._(C,"left"),..._(h,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),m=o.useRef(l);o.useEffect(()=>{m.current=l},[l]);const p=o.useRef(null),f=o.useRef(null),b=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&f.current==null&&(f.current=b()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const U=setTimeout(()=>m.current?.(),0);return()=>clearTimeout(U)}const C=1200,h=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=U=>Math.max(40,(U||window.innerWidth)*.02),y=_?.width||window.innerWidth||375,w=_?.height||window.innerHeight||812,v=U=>{const $=[...U].sort((V,z)=>V-z);return $[Math.floor($.length/2)]||1},B=v(i.map(U=>Math.abs(U.vy))),k=v(i.map(U=>Math.abs(U.vx))),E=Math.sqrt(2*C*(w*.72+g))/B,D=B*E/C,N=y*.5/(k*D),I=(U,$,V)=>Math.min(V,Math.max($,U)),P=I(E,.8,2.4),K=I(N,.7,2.2),T=a>0?a/W_:1,M=i.map(U=>({...U,life:U.life*T,vx:U.vx*K,vy:U.vy*P,startTime:h+U.delay,ended:!1})),L=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Q=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},H=U=>{let $=!1;for(const V of M){const z=c.current[V.id];if(!z||!z)continue;if(U<V.startTime){z.style.display="none",$=!0;continue}if(!V._inited){const W=V.side==="left"?L.x:Q.x,ie=V.side==="left"?L.y:Q.y;z.style.left=`${W}px`,z.style.top=`${ie}px`,z.style.transform="translate3d(0px, 0px, 0)",z.style.display="block",z.style.zIndex="100000",typeof V.color=="string"&&V.color.startsWith("var(")&&(z.style.background=H_(z,V.color)??"#FF0060"),V._inited=!0}const Y=(U-V.startTime)/1e3;if(Y<0)continue;const S=V.life/1e3;if(Y>=S){z.style.opacity="0",z.style.display="none",V.ended=!0;continue}$=!0;const R=V.side==="left"?L.x:Q.x,F=V.side==="left"?L.y:Q.y,Z=R+V.vx*Y,pe=F+V.vy*Y+.5*C*Y*Y,re=(V.angularVel||0)*Y,oe=Z-R,ne=pe-F;z.style.transform=`translate3d(${oe}px, ${ne}px, 0) rotate(${re}deg)`,z.style.opacity=`${Math.max(0,1-Y/S)}`}$?d.current=requestAnimationFrame(H):m.current?.()};d.current=requestAnimationFrame(H);const O=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const U=document.createElement("div");U.className="party-container",U.style.position="fixed",U.style.inset="0",U.style.pointerEvents="none",U.style.overflow="visible",U.style.zIndex="2147483647";for(const $ of i){const V=document.createElement("span");V.className=`confetti confetti--${$.side}`,V.setAttribute("aria-hidden","true"),V.style.display="none",V.style.position="fixed",V.style.left="0px",V.style.top="0px",V.style.width=`${$.size}px`,V.style.height=`${Math.max(4,$.size*.6)}px`,V.style.background=$.color,V.style.borderRadius=$.borderRadius,V.style.transform="translate3d(0,0,0)",V.style.opacity="0",U.appendChild(V),c.current[$.id]=V}(document.body||f.current).appendChild(U),p.current=U}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(O),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,i]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:h=>{c.current[C.id]=h},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${s}`))});return typeof document<"u"?nn.createPortal(x,f.current||document.body):x}const Es=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function V_({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Es(u.count),strength:Es(u.strength),duration:Es(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const l=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(Ns,{active:t,trigger:e}),a&&n.jsx(Ns,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:l})]})}function q_({title:e,sub:t,rightAction:a,titleAction:r,badge:l,badgeVariant:s="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:m}=xe.useTranslation();hy(typeof e=="string"?e:i??null);const p=c??m("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(fe,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),l&&n.jsx("div",{className:"page-title__badge",children:n.jsx(Et,{label:l,size:"small",variant:s,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function U_(e){return e??""}const cd=o.createContext({words:[],loading:!1});function G_(){return o.useContext(cd)}function K_({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const m=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,l,s,i,u,c]);return n.jsx(cd.Provider,{value:m,children:d})}function Y_({items:e,actions:t,columns:a,flat:r=!1,className:l,style:s}){const i=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",l),style:{"--summary-strip-cols":String(i),...s},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const Z_=(e,t)=>`${e} / ${t}`;function X_({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:l=Z_,pageWidth:s,pageHeight:i,margin:u,className:c,style:d}){const{t:m}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const T=p.current;if(!T)return;const M=()=>g(T.scrollWidth>T.clientWidth+1);if(M(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(M);return L.observe(T),()=>L.disconnect()},[C]);const A=e.map(T=>`${T.id}\0${T.section??""}\0${T.group??""}`).join(""),y=C&&C.shape===A?C.pages:null,[w,v]=o.useState(0);o.useEffect(()=>{const T=x.current;if(!T||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>v(T.offsetHeight));return M.observe(T),()=>M.disconnect()},[]);const[B,k]=o.useState(0);o.useEffect(()=>{const T=f.current;if(!T||typeof ResizeObserver>"u")return;let M=null;const L=typeof requestAnimationFrame=="function"?O=>requestAnimationFrame(O):O=>setTimeout(O,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:O=>clearTimeout(O),H=new ResizeObserver(()=>{M==null&&(M=L(()=>{M=null,k(O=>O+1)}))});return Array.from(T.children).forEach(O=>H.observe(O)),()=>{H.disconnect(),M!=null&&Q(M)}},[A]),o.useLayoutEffect(()=>{const T=f.current,M=x.current;if(!T||!M)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Q=new Map;b.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Q.set(S.dataset.chromeSection??"",L(S))});const H=S=>L(M)-(Q.get(S??"")??0),O=Array.from(T.children).map(S=>L(S)),U=[];e.forEach((S,R)=>{const F=U[U.length-1],Z=F?e[F[0]]:void 0;Z&&S.group!=null&&Z.group===S.group&&Z.section===S.section?F.push(R):U.push([R])});const $=[];let V=[],z=0;const Y=()=>{V.length&&$.push(V),V=[],z=0};U.forEach(S=>{const R=S.reduce((Z,pe)=>Z+O[pe],0),F=H(e[S[0]].section);V.length&&e[V[0]].section!==e[S[0]].section&&Y(),R>F?S.forEach(Z=>{V.length&&z+O[Z]>F+.01&&Y(),V.push(Z),z+=O[Z]}):(V.length&&z+R>F+.01&&Y(),S.forEach(Z=>V.push(Z)),z+=R)}),Y(),h(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify($)?S:{shape:A,pages:$})},[A,w,s,i,u,B]);const E=Mo,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),I=(T,M,L)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:L!=null&&t?.[L]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:N}),n.jsx("span",{className:"report-doc__page-no",children:l(T,M)})]})}),P=Array.from(new Set(e.map(T=>T.section??""))),K={...s?{"--report-page-w":s}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:K,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?m("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:x,className:"report-doc__ruler"}),n.jsx("div",{ref:b,children:P.map(T=>{const M=I(1,1,T||void 0);return n.jsxs("div",{"data-chrome-section":T,children:[M.header,M.footer]},T)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(T=>n.jsx("div",{children:T.content},T.id))})]}),y&&n.jsx("div",{className:"report-doc__pages",children:y.map((T,M)=>{const{header:L,footer:Q}=I(M+1,y.length,e[T[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,T.map(H=>n.jsx("div",{children:e[H].content},e[H].id)),Q]},M)})})]})}function J_({title:e,fields:t,columns:a=4,className:r,style:l}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...l},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},i))})]})}const na=new Map;let Mr=null;const Q_=12;function ew(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function Lr(){const e=new Map;for(const t of na.keys()){if(!t.isConnected)continue;const a=ew(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,l)=>r.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const l=r.getBoundingClientRect().height;l>0&&(a+=l+Q_)}}}function tw(e){return typeof window>"u"?()=>{}:(na.set(e,(na.get(e)??0)+1),na.get(e)===1&&typeof ResizeObserver<"u"&&(Mr??(Mr=new ResizeObserver(()=>Lr())),Mr.observe(e)),Lr(),()=>{const t=(na.get(e)??1)-1;if(t>0){na.set(e,t),Lr();return}na.delete(e),Mr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Lr()})}function nw({title:e,message:t,actionLabel:a,onAction:r,icon:l,onClose:s,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),m=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,b=f?tw(f):null;return()=>{b?.(),m.current&&p&&p.contains(document.activeElement)&&sr(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",i),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{m.current=!0,s()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:l??n.jsx(Os,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(fe,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function aw({title:e,titleLevel:t=3,description:a,topActions:r,children:l,footerLeft:s,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:m,onDragEnd:p,className:f}){const b=t?`h${t}`:"div",x=s!=null||i!=null,C=l!=null&&l!==!1,h=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?h:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:m,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(b,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:l}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function rw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:l,beforeSort:s,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:m=!1,onDragOver:p,onDragLeave:f,onDrop:b,children:x,className:C}){const{t:h}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=l!=null,y=_e("training-card-group",m&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:y,onDragOver:p,onDragLeave:f,onDrop:b,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[A&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?h("common.expandFor",{name:e}):h("common.collapseFor",{name:e}):r?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:l}),typeof e=="string"?n.jsx(g,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(s!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:w=>w.stopPropagation(),children:[s,i&&n.jsx(cn,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?h("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:x}))]})}const ow="speechear:saved_word_tables";function sw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function lw(){try{const e=localStorage.getItem(ow);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(sw):[]}catch{return[]}}function dd(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Ds(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function iw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let l=2;t.has(r);l++)r=`${a.id}~${l}`;return t.add(r),r===a.id?a:{...a,id:r}})}function uw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:l,filterDefaultCollapsed:s,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:m,items:p,onSaveComplete:f,onLoad:b,onRemoveItem:x,onReset:C,resetLabel:h,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:y,onAddItem:w,className:v,renderSavePopup:B,renderWordSearch:k,hideControls:E,saveOnly:D,tableName:N,nameValue:I,onNameChange:P,descriptionValue:K,onDescriptionChange:T,namePlaceholder:M,descriptionPlaceholder:L,existingNames:Q,editingName:H,onCancel:O,initialItemsPerPage:U,renderCellAction:$,actionsLeftExtra:V}){const{t:z}=xe.useTranslation(),Y=h??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,R=!!P,[F,Z]=o.useState([]),pe=(I??"").trim(),re=pe||(M??"").trim(),oe=(K??"").trim()||(L??"").trim(),ne=(Q??[]).map(ee=>ee.trim().toLowerCase()),W=[H?.trim().toLowerCase(),...F].filter(ee=>!!ee),ie=[...ne];for(const ee of W){const ve=ie.indexOf(ee);ve!==-1&&ie.splice(ve,1)}const q=pe!==""&&ie.includes(pe.toLowerCase()),[G,de]=o.useState(Array(4).fill(null)),[Ee,ye]=o.useState(4),[me,se]=o.useState(null),Ce=G.slice(0,Ee),ge=!!d?.show,[ce,Me]=o.useState(!0),[Oe,Le]=o.useState(!0),ze=d&&{...d,top:ce,bottom:Oe},[We,dt]=o.useState("landscape"),[lt,at]=o.useState(["image","word","standardPron"]),[mt,Ae]=o.useState("show"),[qe,we]=o.useState(!0),[Ue,ke]=o.useState(!0),$e=o.useRef(null),je=o.useRef([]),[Ze,yt]=o.useState(U==="all"?Number.POSITIVE_INFINITY:U??8),[et,Xe]=o.useState("right"),[_t,Ct]=o.useState(!1),[wt,Bt]=o.useState(!1),{toastMessage:ht,toastType:rt,showWarning:te,clearToast:Ne}=Oi("warning"),Je=o.useCallback(()=>se(null),[se]);w&&!S&&!y&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[Ve,it]=o.useState(()=>Math.max(p?.length??1,1)),Se=S?Ee:y?Math.max(Ve,p?.length??1,1):Math.max(p?.length??0,1),{width:pt,height:gt}=ga[We],Pe=!S&&!y,nt=p?.length??0,vt=Math.min(Ze,Math.max(nt,1)),Ge=Pe?vt:Se,ot=Pe?Zu(p??[],Ge):null,st=!!ot&&ot.length>1,ct=S?Ce.some(ee=>ee!==null&&ee.length>1):(p??[]).some(ee=>(ee.words??[]).length>1),kt=N?.trim()||`${Hl(La())} ${ct?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Vt=o.useCallback(()=>st?je.current.filter(ee=>ee!==null):$e.current?[$e.current]:[],[st]),{print:en,openNewWindow:Cn,downloadHtml:jn}=ls({getElements:Vt,paperW:pt,paperH:gt,fileName:kt,onPopupBlocked:()=>{te(z("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),Wn=ee=>{ye(ee),de(ve=>ve.length>=ee?ve:[...ve,...Array(ee-ve.length).fill(null)]),se(null)},Hn=ee=>{de(ve=>{const Re=[...ve];return Re[ee]=null,Re}),me===ee&&se(null)},qt=ee=>{if(me===null)return;const ve=me;de(He=>{const tt=[...He];return tt[ve]=ee.length>0?ee:null,tt});const Re=Ce.findIndex((He,tt)=>tt>ve&&He===null);se(Re!==-1?Re:null)},dn=S?Ce.some(ee=>ee?.some(ve=>!!ve.colloquialPronunciation)):(p??[]).some(ee=>(ee.words??[]).some(ve=>!!ve.colloquialLabel)),Ut=o.useMemo(()=>sa()?S?G.slice(0,Ee).flatMap(ee=>(ee??[]).map(ve=>[ve.word,ve.homonum])):(p??[]).flatMap(ee=>(ee.words??[]).map(ve=>[ve.label,ve.homonum])):[],[S,G,Ee,p]),[Lt,Tn]=o.useState(!1);o.useEffect(()=>{if(Ut.length===0)return;let ee=!1;return Promise.all(Ut.map(([ve,Re])=>Nl(ve,Re))).then(ve=>{ee||Tn(ve.some(Boolean))},()=>{}),()=>{ee=!0}},[Ut]);const ln=Ut.length>0&&Lt,Mn=o.useMemo(()=>[...S||y?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:A4.map(ee=>({value:`${ee}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ee})})),display:"segmented"}]:[],...Pe&&(p?.length??0)>0?[mc(z,{hasPairs:ct,itemCount:nt})]:[],...st?[N4(z)]:[]],[z,S,y,Pe,p?.length,ct,nt,st]),Ln={...S||y?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Se}\uCE78`}:{},...Pe&&(p?.length??0)>0?{[z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${vt}\uAC1C`}:{},...st?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:et}:{}},xn=(ee,ve)=>{ve===z("wordTable.filter.columns","\uCE78 \uC218")?S?Wn(parseInt(ee)):it(parseInt(ee)):ve===z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?yt(hc(parseInt(ee),nt)):ve===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&Xe(fc(ee))},Gt=S?iw(Ce.filter(ee=>ee!==null&&ee.length>0).map(ee=>({id:Ds(ee),words:ee.map(dd)}))):p??[],Ft=()=>{S&&de(ee=>ee.length>Ee?ee.slice(0,Ee):ee)},$t=(ee=!1)=>{if(Bt(ee),R&&f){const ve=re.trim().toLowerCase();ve&&Z(Re=>Re.includes(ve)?Re:[...Re,ve]),f(re,Gt,oe||void 0,ee),Ft();return}if(D&&f){f("",Gt,void 0,ee),Ft();return}if(f){Ct(!0);return}jn()},[pn,Ot]=o.useState(!1),[tn,Tt]=o.useState(""),Kt=tn.trim(),le=Kt!==""&&ne.includes(Kt.toLowerCase()),Be=()=>{Tt(re?z("wordTable.save.copyName",{name:re,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},Te=()=>{!Kt||le||!f||(f(Kt,Gt,oe||void 0,!0),Ft(),Ot(!1))},Ke=Gt.length===0,Fe=Ke||R&&(re===""||q),X=()=>{if(Ke){te(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(R&&re===""){te(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}R&&q&&te(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},ue=n.jsx(ba,{items:Gt,orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Se});return n.jsxs(n.Fragment,{children:[n.jsxs(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[pn&&n.jsx(On,{size:"small",title:g??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ee})=>n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ee}),n.jsx(fe,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Kt||le,onClick:Te})]}),children:n.jsx(Xn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:tn,onChange:Tt,placeholder:z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:Te,error:le?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),_t&&f&&B?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:ue,previewW:pt,previewH:gt,items:Gt,existingNames:lw().map(ee=>ee.name),saveAsNew:wt,onSave:(ee,ve)=>{f(ee,Gt,ve,wt),Ft(),Ct(!1)},onCancel:()=>Ct(!1)}),(S||w)&&me!==null&&k?.({cellIndex:me,onConfirm:S?qt:ee=>{if(w){const ve=ee[0];if(ve){const Re=new Set((p??[]).map(tt=>tt.id));let He=Ds([ve]);for(let tt=2;Re.has(He);tt++)He=`${Ds([ve])}~${tt}`;w({id:He,words:[dd(ve)]})}}se(null)},onClose:Je}),!E&&n.jsx(as,{title:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:ln,hasColloquial:dn,contentTypes:lt,orientation:We,showOutline:qe,cutLine:mt,showDivLine:Ue,setters:{setContentTypes:at,setOrientation:dt,setShowOutline:we,setCutLine:Ae,setShowDivLine:ke,setShowTopInfo:Me,setShowBottomInfo:Le},showCutLine:(Pe?Ge:Se)>1,showDivLine2:ct,middleSections:Mn,extraSelected:Ln,onExtraSelect:xn,showPaperBands:ge,showTopInfo:ce,showBottomInfo:Oe}),st&&ot?n.jsx("div",{className:"word-table-block__pages",children:ot.map((ee,ve)=>n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Ge,items:ee,onRemoveItem:x,onReorder:A&&((Re,He)=>A(Re+ve*Ge,He+ve*Ge)),renderCellAction:$&&((Re,He)=>$(Re+ve*Ge,He)),brand:ze,code:m,contentRef:Re=>{je.current[ve]=Re},pageNumber:{current:ve+1,total:ot.length},pageNumberPosition:et},ve))}):n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Se,items:S?void 0:p??[],editCells:S?Ce:void 0,activeCell:me,onActivateCell:S||w?se:void 0,onRemoveCell:S?Hn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:$,brand:ze,code:m,showFillerAdd:!!w,contentRef:$e}),!E&&!D&&(C||V!=null)&&n.jsxs("div",{className:"word-table-block__table-actions",children:[C&&n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:Y,onClick:C}),V]}),R&&!E&&n.jsxs(Ar,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Dn,{variant:"custom",label:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:I??"",onChange:P,placeholder:M?M+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:q?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(I??"").trim()&&(M??"").trim()&&(ee.preventDefault(),P?.(M??""))}})}),n.jsx(Dn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:K??"",onChange:T,placeholder:L?L+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(K??"").trim()&&(L??"").trim()&&(ee.preventDefault(),T?.(L??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&b&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:b}),!D&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Cn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[O&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:O}),!D&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:en}),g&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>R?Be():$t(!0),disabled:Ke,onDisabledClick:()=>{te(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>$t(!1),disabled:Fe,onDisabledClick:X})]})]}),n.jsx(ha,{message:ht,type:rt,onClose:Ne})]})}function pd({items:e,className:t}){const a=e.length,r=a<=3?1:2,l=Math.ceil(a/r)||1,s=r*l;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(i,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,m)=>n.jsxs(o.Fragment,{children:[m>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},m))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function cw({items:e,name:t,description:a,createdAt:r,code:l,published:s,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:m,publishedAt:p,likeCount:f,downloadCount:b,onPublisherClick:x,selected:C,onClick:h,onMore:_,titleNode:g,className:A}){const{t:y}=xe.useTranslation(),w=g!=null,v=m!=null||p!=null||f!=null||b!=null,B=k=>{k.target===k.currentTarget&&!w&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":l?`${t} (${l})`:t,onClick:w?void 0:h,onKeyDown:B,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":y("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(pd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!w&&n.jsx(fe,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:y("common.moreFor",{name:t}),onClick:k=>{k.stopPropagation(),_(k)}})]}),(l||r||s||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?Wl(r,y):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(Et,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??y("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(Et,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??y("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),l&&n.jsx("span",{className:"word-table-button__code caption-1",children:l})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[m&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":y("wordTable.publisherFilter",{name:m,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:k=>{k.stopPropagation(),x()},children:m}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:m})),p&&n.jsx("span",{className:"training-card__date body-4",children:Wl(p,y)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":y("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),b!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(b),"aria-label":y("common.downloadCount",{count:b,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${b}`})})]})]})]})}/**
1040
+ `).map((i,u,c)=>n.jsxs(o.Fragment,{children:[i,u<c.length-1&&n.jsx("br",{})]},u))})}),n.jsxs("div",{className:"site-footer__links",children:[n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.site.title","\uC0AC\uC774\uD2B8")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:"IHAB"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://speechear.ihab.co.kr/",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.malgwi","\uB9D0\uADC0")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.soundDirection","\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/vr-sound-localization",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.vrSoundDirection","VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://ihab-offcial-web.vercel.app/product/hearing-test-pro",target:"_blank",rel:"noopener noreferrer",children:s("footer.site.hearingTest","\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C")})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.sns.title","SNS")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://blog.naver.com/ihab_official",target:"_blank",rel:"noopener noreferrer",children:s("footer.sns.naverBlog","\uB124\uC774\uBC84 \uBE14\uB85C\uADF8")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.instagram.com/ihab.official.yt/",target:"_blank",rel:"noopener noreferrer",children:"Instagram"})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"https://www.youtube.com/@%EC%95%84%EC%9D%B4%ED%95%B4%EB%B8%8C-%EA%B3%B5%EC%8B%9D%EC%B1%84%EB%84%90",target:"_blank",rel:"noopener noreferrer",children:"Youtube"})})]})]}),n.jsxs("div",{className:"site-footer__column",children:[n.jsx("div",{className:"site-footer__column-title footer-title",children:s("footer.policy.title","\uC815\uCC45")}),n.jsxs("ul",{children:[n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{e&&(i.preventDefault(),e())},children:s("footer.policy.terms","\uC774\uC6A9\uC57D\uAD00")})}),n.jsx("li",{children:n.jsx("a",{className:"footer-link",href:"#",onClick:i=>{t&&(i.preventDefault(),t())},children:s("footer.policy.privacy","\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68")})})]})]})]})]}),n.jsx("hr",{className:"site-footer__rule"}),n.jsxs("div",{className:"site-footer__bottom",children:[n.jsx("div",{className:"site-footer__brand",children:n.jsx("img",{src:Mo,alt:"IHAB",className:"site-footer__logo"})}),n.jsxs("div",{className:"site-footer__meta",children:[n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.ceo","\uB300\uD45C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.ceoName","\uD55C\uC9C0\uD61C")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.address","\uC8FC\uC18C")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.addressValue","\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.bizNo","\uC0AC\uC5C5\uC790\uB4F1\uB85D\uBC88\uD638")})," ",n.jsx("span",{className:"footer-meta caption-1",children:s("footer.bizNoValue","526-81-02926")})]}),n.jsxs("div",{children:[n.jsx("span",{className:"footer-title",children:s("footer.support","\uACE0\uAC1D\uC13C\uD130")})," ",n.jsxs("span",{className:"footer-meta caption-1",children:[r," \xA0 ",l]})]})]})]}),n.jsx("div",{className:"site-footer__copyright footer-copyright caption-1",children:"\xA9 IHAB, Inc. All rights reserved."})]})})}function ux({logo:e,logoAlt:t="",logoHref:a,links:r=[],actions:l,className:s,containerClassName:i,renderLink:u,menuLabel:c}){const{t:d}=xe.useTranslation(),m=c??{open:d("header.menuOpen","\uBA54\uB274 \uC5F4\uAE30"),close:d("header.menuClose","\uBA54\uB274 \uB2EB\uAE30")},[p,f]=o.useState(!1),b=o.useId(),x=o.useRef(null);o.useEffect(()=>{if(!p)return;const _=Gn(()=>{const y=document.getElementById(b);y&&y.contains(document.activeElement)&&x.current?.focus(),f(!1)}),g=typeof window<"u"&&window.matchMedia?window.matchMedia("(min-width: 961px)"):null,A=y=>{y.matches&&f(!1)};return g&&(g.matches&&f(!1),g.addEventListener?.("change",A)),()=>{_(),g?.removeEventListener?.("change",A)}},[p,b]);const C=i?`${i} landing-header__inner`:"landing-header__inner",h=(_,g)=>u?u(_,{onClick:g}):n.jsx("a",{href:_.href,onClick:g,"aria-current":_.current?"page":void 0,children:_.label});return n.jsxs("header",{className:s?`landing-header ${s}`:"landing-header",children:[n.jsxs("div",{className:C,children:[e!=null&&(()=>{const _=typeof e=="string"?n.jsx("img",{src:e,alt:t,className:"landing-header__logo"}):e;return a?n.jsx("a",{href:a,className:"landing-header__brand",children:_}):n.jsx("div",{className:"landing-header__brand",children:_})})(),r.length>0&&n.jsx("nav",{className:"landing-header__links",children:r.map((_,g)=>n.jsx("span",{children:h(_)},`${g}:${_.href}`))}),n.jsxs("div",{className:"landing-header__actions",children:[l,r.length>0&&n.jsx("button",{ref:x,type:"button",onClick:()=>f(_=>!_),"aria-expanded":p,"aria-controls":b,"aria-label":p?m.close:m.open,className:p?"landing-header__toggle landing-header__toggle--open":"landing-header__toggle",children:n.jsxs("span",{className:"landing-header__burger",children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})})]})]}),r.length>0&&n.jsx("nav",{id:b,hidden:!p,className:"landing-header__drawer",children:n.jsx("div",{className:i??void 0,children:r.map((_,g)=>n.jsx("span",{className:"landing-header__drawer-item",children:h(_,()=>f(!1))},`${g}:${_.href}`))})})]})}function cx({children:e,action:t,onClick:a,className:r}){const l=a?"bottom-sticky__inner bottom-sticky__inner--clickable":"bottom-sticky__inner";return n.jsx("div",{className:r?`bottom-sticky ${r}`:"bottom-sticky",children:n.jsxs("div",{className:l,onClick:a,...Hu(a),children:[n.jsx("div",{className:"bottom-sticky__content",children:e}),t]})})}function dx({mountedRef:e}){const t=o.useRef({phase:"sound",at:0}),a=o.useRef(0),r=o.useRef(null),l=o.useRef(null),s=o.useCallback(()=>{const C=t.current,h=C.phase!=="sound"&&C.at>0;l.current=h?{phase:C.phase,elapsed:Math.max(0,Date.now()-C.at)}:null},[]),i=o.useCallback(()=>{const C=l.current;return l.current=null,C},[]),u=o.useCallback(()=>{a.current+=1,t.current={phase:"sound",at:0}},[]),c=o.useCallback((C,h,_=0)=>{if(!(C>0))return Promise.resolve(!0);const g=a.current;return t.current={phase:h,at:Date.now()-Math.max(0,_)},new Promise(A=>{const y=setTimeout(()=>{r.current===y&&(r.current=null),A(!!e.current&&g===a.current)},C);r.current=y})},[e]),d=o.useCallback(()=>{t.current={phase:"sound",at:Date.now()}},[]),m=o.useCallback(()=>{t.current={phase:"sound",at:0}},[]),p=o.useCallback(()=>{const C=t.current;return C.phase!=="sound"&&C.at>0},[]),f=o.useCallback(()=>a.current,[]),b=o.useCallback(C=>C===a.current,[]),x=o.useCallback(()=>{a.current+=1},[]);return o.useEffect(()=>()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o.useMemo(()=>({positionRef:t,isRunning:p,generation:f,isCurrent:b,abort:u,waitPad:c,enterSound:d,leave:m,pause:s,resume:i,__bumpGenerationForTest:x}),[p,f,b,u,c,d,m,s,i,x])}const va=9,px=e=>Math.round(Math.min(va,Math.max(0,e))/va*100),mx=e=>e/100*va,Xa=2,_c=.1,hx=e=>Math.min(Xa,Math.max(0,e)),fx=.1,Cx=e=>Math.round(e*1e6)/1e6;function Ja(e){const{noiseRatio:t}=e;if(typeof t=="number"&&Number.isFinite(t))return hx(t);const a=Math.min(va,Math.max(0,Number(e.level)||0))/va,r=Number(e.mainVolume);return r>0?a>0?Cx(Math.min(Xa,Math.max(fx,a/r))):0:1}const wc=e=>Math.min(1,Math.max(0,Number(e.mainVolume)||0));function Bc(e){return wc(e)}function cs(e){return wc(e)*Ja(e)}function ds(e,t=Tf()){const a=Number.isFinite(t)&&t>0?t:1;return Math.min(1,cs(e)/a)}function Jn(e,t){const a={...e,...t??{}};return t&&"level"in t&&typeof t.noiseRatio!="number"&&(a.noiseRatio=Ja({level:a.level,mainVolume:a.mainVolume})),a}const Qn={enabled:!0,type:"defaultNoise",level:4.5,noiseRatio:1,speed:1,mainVolume:1,mainSpeed:1},ps=o.createContext(null);function xr(){return o.useContext(ps)}const ms=e=>`${jf()}/${e}`,kc=e=>Array.from({length:10},(t,a)=>ms(`${e}-${String(a+1).padStart(2,"0")}.mp3`)),_r={get defaultNoise(){return ms("noise1.mp3")},get street(){return kc("noise2")},get restaurant(){return kc("noise3")},get buzz(){return ms("noise4.mp3")}};function gx(e){const t=Math.floor(Math.random()*10);switch(e){case"defaultNoise":return _r.defaultNoise;case"street":return _r.street[t];case"restaurant":return _r.restaurant[t];case"buzz":return _r.buzz;default:return null}}function bx({noisePlayer:e,audioRef:t,playbackStateRef:a,sequencer:r}){const l=o.useRef(e?.registerAnalyser);l.current=e?.registerAnalyser;const s=o.useRef(null),[i,u]=o.useState(null),c=o.useRef(null),d=o.useRef(null),m=o.useRef(null),p=o.useRef(null),f=o.useRef(0),b=o.useRef(null),x=o.useCallback(()=>!!r?.isRunning(),[r]),C=o.useCallback(()=>{p.current!==null&&(cancelAnimationFrame(p.current),p.current=null),b.current!==null&&(clearTimeout(b.current),b.current=null)},[]),h=o.useCallback((w,v=250)=>{const B=s.current;if(!B)return;const k=d.current;if(k){d.current=null;try{B.pause()}catch{}B.src=k,B.load()}if(!B.src)return;f.current+=1,C();try{eo(),er(B).then(I=>{if(s.current===B)try{l.current?.("noise",I)}catch{}})}catch{}const E=B.paused?0:tr(B);B.paused&&In(B,0),B.play().catch(()=>{});const D=performance.now(),N=()=>{const I=Math.min(1,(performance.now()-D)/v);try{In(B,E+(w-E)*I)}catch{}I<1?p.current=requestAnimationFrame(N):p.current=null};p.current=requestAnimationFrame(N)},[C]),_=o.useCallback((w=250,v)=>{const B=s.current;if(!B||B.paused){v?.();return}const k=++f.current;C();const E=performance.now(),D=tr(B),N=()=>{const I=Math.min(1,(performance.now()-E)/w);try{In(B,D*(1-I))}catch{}if(I<1)p.current=requestAnimationFrame(N);else{p.current=null,b.current!==null&&(clearTimeout(b.current),b.current=null);try{B.pause()}catch{}v?.()}};p.current=requestAnimationFrame(N),b.current=setTimeout(()=>{if(b.current=null,f.current===k){p.current!==null&&(cancelAnimationFrame(p.current),p.current=null);try{B.paused||(In(B,0),B.pause(),v?.())}catch{}}},w+150)},[C]);o.useEffect(()=>{const w=document.createElement("audio");return w.loop=!0,w.crossOrigin="anonymous",s.current=w,()=>{C();try{w.pause(),w.removeAttribute("src"),w.load()}catch{}s.current=null,c.current=null,d.current=null}},[C]);const g=e?ds(e.settings):0,A=!!e?.settings.enabled&&g>0;o.useEffect(()=>{if(!A)return;let w=0;const v=setInterval(()=>{const B=s.current;if(!B||B.paused){w=0;return}const k=t.current;if(k&&!k.paused&&!k.ended||x()||a.current==="playing"){w=0;return}w+=1,w>=2&&(w=0,_())},400);return()=>clearInterval(v)},[_,A,t,a,x]),o.useEffect(()=>{const w=()=>{const v=s.current;if(document.hidden){if(v&&!v.paused){C();try{v.pause()}catch{}}return}if(!v||!v.paused)return;const B=t.current,k=!!B&&!B.paused&&!B.ended||x()||a.current==="playing",E=m.current;k&&E?.enabled&&E.volume>0&&h(E.volume)};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)},[C,h,t,a,x]),o.useEffect(()=>{m.current=e?{enabled:e.settings.enabled,volume:g,type:e.settings.type}:null},[e,e?.settings.enabled,g,e?.settings.type]);const y=o.useRef(null);return o.useEffect(()=>()=>{y.current?.(),y.current=null},[]),o.useEffect(()=>{const w=e?.settings,v=s.current;if(!v)return;const B=w?ds(w):0;if(!w||!w.enabled||B===0){_();return}if(c.current!==w.type){const k=gx(w.type);k&&(c.current=w.type,u(k),d.current=k,_(150,()=>{if(d.current!==k)return;d.current=null,v.src=k,v.load();const E=t.current;if(E&&!E.paused||x()){y.current?.();const D=()=>{v.removeEventListener("canplay",D),y.current===N&&(y.current=null);const I=t.current,P=m.current;(I&&!I.paused&&!I.ended||x())&&P?.enabled&&P.volume>0&&h(P.volume)},N=()=>v.removeEventListener("canplay",D);y.current=N,v.addEventListener("canplay",D)}}))}else{const k=t.current,E=!!k&&!k.paused&&!k.ended||x()||a.current==="playing";if(E&&d.current)h(B);else if(E&&v.paused&&v.src)h(B);else if(!v.paused)if(!E)_();else{C();const D=tr(v),N=performance.now(),I=()=>{const P=Math.min(1,(performance.now()-N)/150);try{In(v,D+(B-D)*P)}catch{}P<1?p.current=requestAnimationFrame(I):p.current=null};p.current=requestAnimationFrame(I)}}},[e?.settings,e?.settings.enabled,g,e?.settings.type,C,h,_,t,a,m,x]),o.useEffect(()=>{const w=s.current;if(w)try{w.playbackRate=Math.min(1.25,Math.max(.75,e?.settings.speed??1))}catch{}},[e?.settings.speed]),{noiseAudioRef:s,activeNoiseUrl:i,noiseSettingsRef:m,cancelNoiseFade:C,fadeInNoise:h,fadeOutNoise:_}}function yx({ttsText:e,playbackRate:t,mainVolume:a,fillRef:r,waveProgressRef:l,setProgress:s,setPlaybackState:i,setStateLocal:u,fadeInNoise:c,fadeOutNoise:d,noiseSettingsRef:m,onDoneRef:p,handleEndRef:f}){const b=o.useRef(null),x=o.useRef(0),C=o.useRef(null),h=o.useRef(0),_=o.useRef(!1);o.useEffect(()=>()=>{h.current++;try{if(C.current&&(cancelAnimationFrame(C.current),C.current=null),_.current&&window.speechSynthesis){try{window.speechSynthesis.cancel()}catch{}_.current=!1}}catch{}},[]);const g=(w,v=1)=>{try{const B=(w||"").trim().split(/\s+/).filter(Boolean).length||Math.max(1,(w||"").length);return Math.max(700,Math.round(B*300/Math.max(.25,v)))}catch{return 1200}},A=o.useCallback(w=>{if(typeof window>"u"||!window.speechSynthesis){try{typeof p.current=="function"&&p.current(!1)}catch{}return}const v=window.speechSynthesis,B=++h.current;try{try{v.cancel()}catch{}const k=w??e,E=Array.isArray(k)?k.filter(T=>!!T):[k||""];E.length===0&&E.push("");const D=Math.max(.3,Math.min(3,t));x.current=E.reduce((T,M)=>T+g(M,D||1),0),b.current=performance.now(),s(0),i("playing"),u("playMode");const N=m.current;N?.enabled&&(N?.volume??0)>0&&c(N.volume);const I=()=>{try{const T=b.current||performance.now(),M=performance.now()-T,L=x.current||1200,Q=Math.min(1,M/L);try{r.current&&(r.current.style.left=`${Q*100}%`),l.current&&l.current.style.setProperty("--progress",String(Q))}catch{}Q<1&&(C.current=requestAnimationFrame(I))}catch{}},P=()=>{if(B===h.current)try{C.current&&(cancelAnimationFrame(C.current),C.current=null),s(1),i("stopped");try{f.current?.()}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{}},K=T=>{const M=new SpeechSynthesisUtterance(E[T]);try{M.rate=D}catch{}try{M.volume=Math.max(0,Math.min(1,a))}catch{}M.onend=()=>{if(B===h.current){if(T<E.length-1){try{K(T+1)}catch{P()}return}P()}},M.onerror=()=>{P()},M.onstart=()=>{if(!(T>0))try{C.current&&(cancelAnimationFrame(C.current),C.current=null),C.current=requestAnimationFrame(I)}catch{}},_.current=!0,v.speak(M)};try{K(0)}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}}catch{try{typeof p.current=="function"&&p.current(!0)}catch{}}},[e,t,a,c,r,l,s,i,u,m,p,f]),y=o.useCallback(()=>{h.current++;try{if(window.speechSynthesis)try{window.speechSynthesis.cancel()}catch{}C.current&&(cancelAnimationFrame(C.current),C.current=null),d(),b.current=null}catch{}i("stopped"),u("active"),s(0)},[d,i,u,s]);return{startTTS:A,stopTTS:y}}const vx=.01,xx=.3;async function _x(e,t,a,r=!1){let l=null;try{const s=window.AudioContext||window.webkitAudioContext;l=new s;const i=await l.decodeAudioData(e.slice(0)),u=i.numberOfChannels>0?i.getChannelData(0):null;if(!u)return null;let c=0;if(r){const b=Math.floor(xx*i.sampleRate),x=Math.min(u.length,b);for(;c<x&&Math.abs(u[c])<=vx;)c++;c>=x&&(c=0)}const d=u.length-c,m=a&&a>0?Math.min(d,Math.floor(a*i.sampleRate)):d,p=Math.max(t,m),f=Math.floor(p/t)||1;return new Array(t).fill(0).map((b,x)=>{const C=c+x*f,h=Math.min(C+f,c+p,u.length);let _=0;for(let g=C;g<h;g++){const A=Math.abs(u[g]);A>_&&(_=A)}return _})}catch{return null}finally{try{l?.close?.()}catch{}}}async function Ac(e,t,a,r=!1){try{const l=await fetch(e);if(l.ok===!1)return null;const s=await l.arrayBuffer();return await _x(s,t,a,r)}catch(l){try{const s=$l(l)}catch{}return null}}const hs=45,wx=74,Bx=2;function wr(e){const t=Math.min(2,Math.max(0,Number(e)||0));return t<=1?t*45:45+(t-1)*29}function Br(e){return wr(e)/45}const kx=e=>Math.max(0,(typeof e=="number"&&Number.isFinite(e)?e:0)*1e3),Nc=e=>Math.max(0,typeof e=="number"&&Number.isFinite(e)?e:0);function Ec({durationsSec:e,leadInMs:t=0,tailMs:a=0}){const r=Nc(t),l=Nc(a),s=[];let i=0;return e.forEach((u,c)=>{for(const[d,m]of[["lead",r],["sound",kx(u)],["tail",l]])s.push({kind:d,track:c,startMs:i,durMs:m}),i+=m}),{segments:s,totalMs:i,trackCount:e.length}}function Dc(e,t){const a=(t|0)*3;if(t<0||a+2>=e.segments.length)return null;const[r,l,s]=[e.segments[a],e.segments[a+1],e.segments[a+2]];return{lead:r,sound:l,tail:s,totalMs:r.durMs+l.durMs+s.durMs}}function Ax(e,t){const a=Dc(e,t.track);if(!a||!(a.totalMs>0))return 0;const r=a[t.kind],l=Math.min(Math.max(0,Number.isFinite(t.elapsedMs)?t.elapsedMs:0),r.durMs);return Math.max(0,Math.min(1,(r.startMs-a.lead.startMs+l)/a.totalMs))}function Nx(e,t,a){const r=Math.max(0,Math.floor(a)),l=Dc(e,t);if(!l||r===0||!(l.totalMs>0)||l.lead.durMs===0&&l.tail.durMs===0||!(l.sound.durMs>0))return{lead:0,sound:r,tail:0};const s=Math.round(l.lead.durMs/l.totalMs*r),i=Math.round(l.tail.durMs/l.totalMs*r),u=Math.max(1,r-s-i),c=s+u+i-r;return{lead:Math.max(0,s-Math.ceil(c/2)),sound:u,tail:Math.max(0,i-Math.floor(c/2))}}function Ex({currentTime:e,sources:t,index:a,audioDuration:r}){const l=a||0,s=Array.isArray(t)&&t.length>0?t[l]:void 0,i=s?s.duration||r||0:r||0;if(!(i>0))return 0;const u=Number.isFinite(e)?e:0;return Math.max(0,Math.min(1,u/i))}function Dx({phase:e,phaseElapsedMs:t,currentTime:a,trackDurationSec:r,leadInMs:l,tailMs:s}){const i=Ec({durationsSec:[r],leadInMs:l,tailMs:s});return Ax(i,{track:0,kind:e,elapsedMs:e==="sound"?(Number.isFinite(a)?a:0)*1e3:t})}function Sx({bars:e,trackDurationSec:t,leadInMs:a,tailMs:r}){return Nx(Ec({durationsSec:[t],leadInMs:a,tailMs:r}),0,e)}function jx(e,t){if(!Array.isArray(e))return null;const a=t||0;return a<e.length-1?a+1:null}function Tx({ended:e,completedByEnd:t}){return!!e||!!t}function Mx(e){return e.map((t,a)=>({src:t.src,label:String(a+1),color:void 0,duration:t.duration||0}))}function Lx(e){return e.reduce((t,a)=>t+(a.duration||0),0)}function $x(e,t,a){const r=Array.isArray(e)?e:e?[e]:[],l=[];for(const s of r)if(s){if(typeof s=="object"&&s!==null&&"src"in s&&s.src){const i=s;l.push({code:i.code??null,src:i.src});continue}if(typeof s=="string"&&(s.startsWith("http")||s.includes("/"))){l.push({code:null,src:s});continue}if(typeof s=="string"||typeof s=="number"){const i=String(s),u=a(i,t);u&&l.push({code:i,resolvedPath:u})}}return l}function Rx(e,t){if(!t||e.readyState<1)return!0;const a=e.currentSrc||e.src;return a?Sc(a)!==Sc(t):!0}function Sc(e){try{return new URL(e,typeof location>"u"?"http://localhost/":location.href).href}catch{return e}}const jc=4,Px=Br(jc/hs);function Ix(e){const{src:t,segments:a,progress:r=0,waveProgressRef:l,noiseSrc:s,noiseRatio:i=0,noiseSpeed:u=1,totalDuration:c=0,mainVolume:d=1,onReadyChange:m,showSoundWaveForm:p=!0,leadInMs:f=0,tailMs:b=0,trackDurationSec:x=0}=e,C=o.useRef(null),h=o.useRef(null),[_,g]=o.useState(null),[A,y]=o.useState(!1),[w,v]=o.useState(null),[B,k]=o.useState(2),[E,D]=o.useState(0),[N,I]=o.useState(null),[P,K]=o.useState(!1),[T,M]=o.useState(!1),L=3,Q=3,H=1,O=300,U=o.useRef(0),$=o.useCallback(()=>{const ye=C.current,me=h&&h.current?h.current:ye?ye.closest(".audio-player__wave"):null,se=me?me.getBoundingClientRect():ye?ye.getBoundingClientRect():null,Ce=se?se.width:0,ge=se?Math.max(100,se.width):320,ce=se?se.height:0,Me=Math.max(H,Math.min(O,Math.floor((ge+Q)/(L+Q)))),Oe=Me*L,Le=Math.max(0,Me-1),ze=Math.max(0,Le>0?(ge-Oe)/Le:Q);return{bars:Me,gap:ze,height:ce,width:Ce}},[]),V=o.useRef(void 0),z=o.useRef(null),Y=o.useCallback(async(ye,me,{quiet:se=!1}={})=>{const Ce=++U.current,ge=()=>U.current===Ce;try{if(se||y(!1),V.current=ye,!ye){ge()&&g(null);return}let ce=me;if(!ce)try{for(let Le=0;Le<4&&!(C.current||h.current);Le++)await new Promise(ze=>requestAnimationFrame(ze));await new Promise(Le=>requestAnimationFrame(Le));const Oe=$();Oe.height>0&&D(Oe.height),ce=Oe.bars,k(Oe.gap)}catch{ce=120}z.current=ce;const Me=await Ac(ye,ce);if(!ge())return;if(!Me){g(null),y(!1);return}g(Me),v(ce),y(!0)}catch{if(!ge())return;g(null),y(!1)}},[y,g,D,k,v,$]);o.useEffect(()=>{const ye=h.current;if(!ye||typeof ResizeObserver>"u")return;let me=null;const se=new ResizeObserver(()=>{me!==null&&cancelAnimationFrame(me),me=requestAnimationFrame(()=>{me=null;try{const Ce=$();if(Ce.width<=0||(Ce.height>0&&D(Ce.height),z.current===null||Ce.bars===z.current))return;const ge=V.current;k(Ce.gap),ge?Y(ge,Ce.bars,{quiet:!0}).catch(()=>{}):z.current=Ce.bars}catch{}})});return se.observe(ye),()=>{se.disconnect(),me!==null&&cancelAnimationFrame(me)}},[$,Y]),o.useEffect(()=>{const ye=a&&a[0]&&a[0].src||t||a&&a.length===1&&a[0]&&a[0].src;Y(typeof ye=="string"?ye:void 0).catch(()=>{}),M(!1)},[t,a,Y]),o.useEffect(()=>{let ye=!1;if(K(!1),I(null),!s||!w)return;const me=c>0?c*(u||1):void 0;return Ac(s,w,me,!0).then(se=>{ye||(I(se),se||K(!0))}).catch(()=>{ye||(I(null),K(!0))}),()=>{ye=!0}},[s,w,c,u]);const S=Math.max(0,Math.min(1,d)),R=o.useMemo(()=>_&&_.length&&Math.max(..._)||1,[_]),F=w||40,Z=o.useMemo(()=>Sx({bars:F,trackDurationSec:x,leadInMs:f,tailMs:b}),[F,x,f,b]),pe=o.useMemo(()=>Array.from({length:F}).map((ye,me)=>{const se=me>=Z.lead&&me<Z.lead+Z.sound,Ce=Z.sound>0&&se?Math.min(F-1,Math.round((me-Z.lead)/Z.sound*F)):-1,ge=se?_&&_[Ce]!=null?_[Ce]:null:_?0:null,ce=ge==null?null:Math.min(1,ge/R*S),Me=ce!=null&&E>0&&wr(ce)<=jc,Oe=ce==null?.15:Me?0:Br(ce),Le=Me,ze=F>1?me/(F-1):0;return n.jsx("div",{className:Le?"audio-player__bar audio-player__bar--hidden":"audio-player__bar",style:{"--val":Oe,"--i":me,"--mix":ze}},me)}),[F,_,R,S,E,Z]),re={"--progress":String(Math.max(0,Math.min(1,r)))},oe=o.useMemo(()=>N&&N.length&&Math.max(...N.map(ye=>Number.isFinite(ye)?Math.abs(ye):0))||1,[N]),ne=S*Math.max(0,i),W=!s||!N||!N.length?1:Math.max(1,ne),ie={"--bar-gap":`${B}px`,"--wave-h":`${wr(W)}px`,"--wave-h1":`${hs}px`},q=A&&(s?!!N||P:!0);o.useEffect(()=>{q&&M(!0)},[q]);const G=T?A:q;o.useEffect(()=>{m?.(G)},[G,m]);const de=w||40,Ee=o.useMemo(()=>Array.from({length:de}).map((ye,me)=>{const se=N&&N[me]!=null?N[me]:null,Ce=se==null?0:Math.abs(se)/oe*ne,ge=Math.max(Px,Br(Ce)),ce=de>1?me/(de-1):0;return n.jsx("div",{className:"audio-player__bar",style:{"--val":ge,"--i":me,"--mix":ce}},me)}),[de,N,oe,ne,E]);return n.jsxs("div",{className:"audio-player__wave",ref:h,style:ie,children:[s&&n.jsx("div",{className:`audio-player__wave-noise ${q?"is-ready":""}`,"aria-hidden":"true",children:Ee}),p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-unplayed ${G?"is-ready":""}`,ref:C,children:pe}),n.jsx("div",{className:`audio-player__wave-inner audio-player__wave-played ${G?"is-ready":""}`,ref:l,style:re,children:pe})]})]})}const Tc={idle:!1,synthesizing:!0,resolving:!0,checking_exists:!0,getting_signed_url:!0,downloading:!0,measuring_duration:!0,ready:!1,error:!0};function fs(e,t){return new Promise((a,r)=>{const l=document.createElement("audio");let s=!1;const i=()=>{try{l.removeAttribute("src"),l.load()}catch{}},u=()=>{if(s)return;s=!0;const d=isFinite(l.duration)&&l.duration||0;i(),a(d)},c=d=>{s||(s=!0,i(),t.rejectOnError?r(new Error(d)):a(0))};l.addEventListener("loadedmetadata",u),l.addEventListener("error",()=>c("audio load failed")),setTimeout(()=>c("audio load timeout"),t.timeoutMs),l.src=e})}const Fx=2e3;function Mc(e,t=Fx){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.addEventListener("canplay",l,{once:!0}),e.addEventListener("error",l,{once:!0}),setTimeout(l,t)})}function Ox({showSoundWaveForm:e,showNoiseWaveForm:t,timeoutMs:a=2500}){const r=o.useRef(!1),l=o.useRef([]),s=o.useCallback(c=>{if(r.current=c,!c||!l.current.length)return;const d=l.current;l.current=[];for(const m of d)m(!0)},[]),i=o.useCallback(()=>{r.current=!1},[]),u=o.useCallback(()=>!e&&!t||r.current?Promise.resolve(!0):new Promise(c=>{const d=p=>{clearTimeout(m),l.current=l.current.filter(f=>f!==d),c(p)},m=setTimeout(()=>d(!0),a);l.current.push(d)}),[e,t,a]);return o.useEffect(()=>()=>{const c=l.current;l.current=[];for(const d of c)d(!1)},[]),{onReadyChange:s,waitForReady:u,markNotReady:i}}function zx(){const e=o.useRef([]),t=o.useCallback(l=>(e.current.push(l),l),[]),a=o.useCallback(l=>{const s=new Set([...l].filter(Boolean));e.current=e.current.filter(i=>{if(s.has(i))return!0;try{URL.revokeObjectURL(i)}catch{}return!1})},[]),r=o.useCallback(()=>{a([])},[a]);return o.useEffect(()=>()=>{for(const l of e.current)try{URL.revokeObjectURL(l)}catch{}e.current=[]},[]),{track:t,keepOnly:a,revokeAll:r}}function Wx({offsetY:e=8}={}){const t=o.useRef(null),[a,r]=o.useState(null),l=o.useCallback(()=>r(null),[]),s=o.useCallback(()=>{try{const i=t.current?.getBoundingClientRect();if(!i)return;r({left:i.left,right:i.right,width:i.width,height:i.height,x:i.x,top:i.top+e,bottom:i.bottom+e,y:i.y+e,toJSON:i.toJSON.bind(i)})}catch{}},[e]);return o.useEffect(()=>{if(a)return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[a,l]),{ref:t,rect:a,show:s,hide:l}}function Hx(e){if(!e)return 0;const t=e.duration;if(Number.isFinite(t)&&t>0)return t;if(t===0)return 0;try{const a=e.seekable;if(a&&a.length>0){const r=a.end(a.length-1);if(Number.isFinite(r)&&r>0)return r}}catch{}return null}const Vx=400,qx=2e3,Lc=5;function Ux({audioRef:e,fillRef:t,waveProgressRef:a,sourcesRef:r,currentIndexRef:l,sequencer:s,leadInMs:i=0,tailMs:u=0}){const c=o.useRef(null),d=o.useRef(0),m=o.useRef(null),p=o.useCallback(()=>{c.current!==null&&(cancelAnimationFrame(c.current),c.current=null)},[]),f=o.useCallback(()=>{if(c.current!==null)return;let x=0;const C=()=>{if($n){const h=typeof performance<"u"&&performance.now?performance.now():Date.now();if(x>0&&h-x>Vx){const _=m.current===null||h-m.current>qx;if(m.current=h,_&&d.current<Lc){d.current+=1;const g=d.current;let A=null;try{A=typeof document<"u"?document.visibilityState:null}catch{}St(`progress-ticker-slow-frames#${g}`,`[ihab-core] \uC9C4\uD589 \uC0AC\uC2AC\uC758 \uD2C0 \uC0AC\uC774\uAC00 ${Math.round(h-x)}ms \uC785\uB2C8\uB2E4(\uBCF4\uD1B5 16ms).`,A==="hidden"?"\uC774 \uCE78\uC774 **\uC228\uC5B4 \uC788\uC5B4** \uBE0C\uB77C\uC6B0\uC800\uAC00 \uD2C0\uC744 \uC904\uC600\uC2B5\uB2C8\uB2E4 \u2014 \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC740 \uD2C0\uB9C8\uB2E4 \uADF8\uB824\uC9C0\uBBC0\uB85C, \uC9C0\uAE08 \uC7AC\uB294 \uAC12\uC740 **\uC0AC\uB78C\uC774 \uBCF4\uB294 \uD654\uBA74\uACFC \uB2E4\uB985\uB2C8\uB2E4.** \uCE78\uC744 \uC55E\uC73C\uB85C \uAEBC\uB0B4\uACE0 \uB2E4\uC2DC \uC7AC\uC2ED\uC2DC\uC624.":"\uCE78\uC740 \uBCF4\uC774\uB294\uB370 \uD2C0\uC774 \uB290\uB9BD\uB2C8\uB2E4 \u2014 \uAC19\uC740 \uD654\uBA74\uC5D0\uC11C \uBB34\uAC70\uC6B4 \uC77C\uC774 \uB3C4\uB294\uC9C0 \uBCF4\uC2ED\uC2DC\uC624. \uC7AC\uC0DD\uBC14\xB7\uD30C\uD615\uC774 \uB04A\uACA8 \uBCF4\uC774\uB294 \uAC83\uC740 \uC774 \uD0D3\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.",g>=Lc?`(${g}\uBC88\uC9F8 \u2014 \uB354\uB294 \uC548 \uC54C\uB9BD\uB2C8\uB2E4)`:`(${g}\uBC88\uC9F8)`)}}x=h}try{const h=e.current,_=Array.isArray(r.current)?r.current[l.current||0]:void 0,g=!!_&&Number.isFinite(_.duration)&&(_.duration??0)>0,A=g?0:Hx(h),y=t.current,w=(i||0)>0||(u||0)>0,v=w&&(s?.positionRef.current?.phase??"sound")!=="sound";if(A===null&&!v)try{y&&y.style.visibility!=="hidden"&&(y.style.visibility="hidden")}catch{}else{const B=g?_.duration:A||0;$n&&v&&!(B>0)&&St("progress-ticker-pad-without-duration","[ihab-core] \uB738\uC774 \uB3C4\uB294\uB370 **\uC18C\uB9AC \uAE38\uC774\uB97C \uBAA8\uB985\uB2C8\uB2E4** \u2014 \uC7AC\uC0DD\uBC14\uAC00 \uB738\uB9CC\uC73C\uB85C \uC5B4\uB9BC\uC7A1\uC544 \uC6C0\uC9C1\uC785\uB2C8\uB2E4.","\uC18C\uB9AC \uAE38\uC774 \uC7AC\uAE30(measureAudioDuration)\uAC00 0 \uC744 \uC92C\uAC70\uB098 `<audio>` \uAC00 \uC544\uC9C1 \uC548 \uC2E4\uB838\uC2B5\uB2C8\uB2E4. \uAE38\uC774\uB97C \uC54C\uAC8C \uB418\uBA74 \uB9C8\uCEE4\uAC00 \uADF8 \uC21C\uAC04 **\uB4A4\uB85C \uBB3C\uB7EC\uB0A9\uB2C8\uB2E4**(\uC5B4\uB9BC\uC740 \uB298 \uCC38\uBCF4\uB2E4 \uD07D\uB2C8\uB2E4). \uC774 \uC904\uC774 \uBCF4\uC774\uBA74 \uADF8 \uC790\uB9AC\uB97C \uC54C\uB824 \uC8FC\uC2ED\uC2DC\uC624 \u2014 \uD3C9\uC18C \uAE38\uC5D0\uC11C\uB294 \uC548 \uB098\uC640\uC57C \uD569\uB2C8\uB2E4.");const k=w?Dx({phase:s?.positionRef.current?.phase??"sound",phaseElapsedMs:s?.positionRef.current?Math.max(0,Date.now()-s.positionRef.current.at):0,currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,trackDurationSec:B,leadInMs:i||0,tailMs:u||0}):Ex({currentTime:h&&typeof h.currentTime=="number"?h.currentTime:0,sources:r.current,index:l.current,audioDuration:A??0});try{y&&(y.style.visibility&&(y.style.visibility=""),y.style.left=`${k*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(k))}catch{}}}catch{}c.current=requestAnimationFrame(C)};c.current=requestAnimationFrame(C)},[e,t,a,r,l,s,i,u]),b=o.useCallback(x=>{p();try{t.current&&(t.current.style.visibility="",t.current.style.left=`${x*100}%`)}catch{}try{a.current?.style.setProperty("--progress",String(x))}catch{}},[p,t,a]);return o.useEffect(()=>p,[p]),{start:f,stop:p,settleTo:b}}function Cs({btnLabel:e,soundSrc:t,bucketPath:a,onDone:r,disabled:l=!1,ttsText:s=null,className:i,showSoundWaveForm:u=!0,showNoiseWaveForm:c=!0,leadInMs:d=0,tailMs:m=0}){const{t:p}=xe.useTranslation(),f=e,b=xr(),x=o.useRef(b?.registerAnalyser);o.useEffect(()=>{x.current=b?.registerAnalyser});const C=o.useRef(null),h=o.useRef(null),_=o.useRef(null),g=zx(),A=o.useRef(null),y=o.useRef(!1),w=o.useRef(null),{ref:v,rect:B,show:k,hide:E}=Wx();o.useEffect(()=>()=>{x.current?.("main",null),x.current?.("noise",null)},[]);const[D,N]=o.useState(!1),[I,P]=o.useState("idle"),[K,T]=o.useState("stopped"),M=o.useRef("stopped");o.useEffect(()=>{M.current=K},[K]);const[L,Q]=o.useState(0),[H,O]=o.useState("active"),U=o.useRef(!1);o.useEffect(()=>{if(H!=="playMode"||!U.current)return;U.current=!1;const X=typeof document<"u"?document.activeElement:null;if(X&&X!==document.body)return;const ue=_.current?.querySelectorAll("button")[1];try{ue?.focus()}catch{}},[H]);const[$,V]=o.useState(null),[z,Y]=o.useState(null),[S,R]=o.useState(0),[F,Z]=o.useState(!1),[pe,re]=o.useState(0),oe=b?.playbackRate??1,ne=b?.mainVolume??1,W=b?cs(b.settings):0,ie=b?Bc(b.settings):ne,[q,G]=o.useState("idle"),[de,Ee]=o.useState(""),[ye]=o.useState("top"),me=o.useRef(null),se=o.useRef(0),Ce=o.useRef(null),ge=o.useRef(!0),ce=dx({mountedRef:ge}),Me=o.useRef(null),Oe=o.useRef(d),Le=o.useRef(m);o.useEffect(()=>{Oe.current=Math.max(0,d||0)},[d]),o.useEffect(()=>{Le.current=Math.max(0,m||0)},[m]);const{start:ze,stop:We,settleTo:dt}=Ux({audioRef:C,fillRef:h,waveProgressRef:Ce,sourcesRef:me,currentIndexRef:se,sequencer:ce,leadInMs:d,tailMs:m}),{onReadyChange:lt,waitForReady:at,markNotReady:mt}=Ox({showSoundWaveForm:u,showNoiseWaveForm:c}),Ae=o.useRef(null),qe=o.useRef(l),we=o.useRef(r),Ue=o.useRef(null),ke=o.useRef(!1),[$e,je]=o.useState(!1),Ze=o.useCallback(X=>{ke.current=X,je(X)},[]),yt=o.useRef(null),{activeNoiseUrl:et,noiseSettingsRef:Xe,fadeInNoise:_t,fadeOutNoise:Ct}=bx({noisePlayer:b,audioRef:C,playbackStateRef:M,sequencer:ce}),{startTTS:wt,stopTTS:Bt}=yx({ttsText:s,playbackRate:oe,mainVolume:ie,fillRef:h,waveProgressRef:Ce,setProgress:Q,setPlaybackState:T,setStateLocal:O,fadeInNoise:_t,fadeOutNoise:Ct,noiseSettingsRef:Xe,onDoneRef:we,handleEndRef:yt});o.useEffect(()=>{it.current=Bt});const ht=X=>{if(typeof window>"u"||!window.speechSynthesis){try{Ee(p("training.ttsUnavailable","\uC774 \uAE30\uAE30\uC5D0\uC11C\uB294 \uC74C\uC131\uC744 \uB4E4\uB824\uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."))}catch{}wt(X);return}Pe("tts"),wt(X)},rt=Array.isArray(t)?t.filter(Boolean):t?[t]:[],te=(!rt||rt.length===0)&&!!s,Ne=Array.isArray($)&&$.length>0?$:Array.isArray(z)&&z.length>0?z:null,Je=Math.max(Array.isArray(Ne)?Ne.length:0,rt.length);o.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]);const Ve=()=>{ce.abort()},it=o.useRef(null),Se=o.useRef(null),pt=o.useRef(null),gt=o.useRef(null);gt.current||(gt.current=()=>{pt.current=null;const X=C.current;if(Se.current==="audio"&&X&&(!X.paused||ce.isRunning())){Ve();try{X.pause()}catch{}ge.current&&(T("paused"),We(),Ct())}else if(Se.current==="tts")try{it.current?.()}catch{}});const Pe=X=>{Se.current=X,pt.current=dr(gt.current)},nt=()=>{pt.current?.(),pt.current=null};o.useEffect(()=>()=>{gt.current&&pr(gt.current)},[]);const vt=o.useRef(oe);o.useEffect(()=>{vt.current=oe||1},[oe]);const Ge=o.useCallback(X=>{const ue=vt.current||1;try{X.defaultPlaybackRate=ue}catch{}try{X.playbackRate=ue}catch{}},[]),ot=o.useCallback((X,ue)=>{if(!Rx(X,ue)){try{X.currentTime=0}catch{}Ge(X);return}X.src=ue,Ge(X),X.load(),Ge(X)},[Ge]),st=o.useCallback(()=>{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),G("idle")},[]),ct=o.useCallback(async(X,ue=3,ee=50,ve=0)=>{st();const Re=ce.generation(),He=!!X&&X.currentTime>0&&!X.ended,tt=Math.max(0,Oe.current-Math.max(0,ve));if(tt>0&&!He){Pe("audio"),ze(),T("playing");const ft=Xe.current;if(ft?.enabled&&(ft.volume??0)>0)try{_t(ft.volume)}catch{}if(!await ce.waitPad(tt,"lead",ve)||!ge.current||!ce.isCurrent(Re))return!1}ce.enterSound();for(let ft=0;ft<ue;ft++){if(!ge.current||!ce.isCurrent(Re))return!1;try{return Pe("audio"),await X.play(),!0}catch(be){if((be instanceof Error||typeof be=="object"&&be&&"name"in be?be.name:void 0)==="AbortError"){if(!ce.isCurrent(Re))return!1;await new Promise(j=>setTimeout(j,ee));continue}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1}}try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}return!1},[p,ze,ce,_t,Xe,st]),kt=o.useCallback(X=>{const ue=ce.generation(),ee=Math.max(0,Le.current-Math.max(0,X));ze();const ve=Xe.current;if(ve?.enabled&&(ve.volume??0)>0)try{_t(ve.volume)}catch{}const Re=()=>{try{Me.current?.()}catch{}};if(ee<=0){ce.leave(),Re();return}ce.waitPad(ee,"tail",X).then(He=>{ce.leave(),He&&ce.isCurrent(ue)&&Re()}).catch(()=>{})},[ce,ze,_t,Xe]),Vt=o.useCallback(()=>{const X=C.current;if(!X)return;const ue=()=>{T("playing"),O("playMode"),Z(!0),ze();try{eo(),er(X).then(He=>{if(ge.current)try{x.current?.("main",He)}catch{}})}catch{}const Re=Xe.current;Re?.enabled&&(Re?.volume??0)>0&&_t(Re.volume)},ee=()=>{Tx({ended:!!X?.ended,completedByEnd:ke.current})||(T("paused"),We(),Ct())},ve=()=>{const Re=()=>{try{const He=me.current,tt=jx(He,se.current);if(tt!==null){se.current=tt,R(tt),Z(!0);const ft=He?.[tt]&&He[tt].src;if(ft&&X){ot(X,ft),ct(X).catch(()=>{});return}}}catch{}T("stopped"),Q(1);try{if(X)try{X.currentTime=0}catch{}}catch{}We(),Z(!1),Ct();try{!qe.current&&yt.current&&yt.current()}catch{}};if(Me.current=Re,Le.current>0){ze(),ce.waitPad(Le.current,"tail").then(He=>{ce.leave(),He&&Re()}).catch(()=>{});return}Re()};return X.addEventListener("play",ue),X.addEventListener("pause",ee),X.addEventListener("ended",ve),()=>{try{X.removeEventListener("play",ue),X.removeEventListener("pause",ee),X.removeEventListener("ended",ve),We()}catch{}}},[_t,Ct,ct,Xe,ze,We,ce]);o.useEffect(()=>Vt(),[Vt]),o.useEffect(()=>{qe.current=l},[l]),o.useEffect(()=>{we.current=r},[r]),o.useEffect(()=>{if(l||H!=="active")return;const X=w.current;if(!X)return;let ue=null;const ee=requestAnimationFrame(()=>{try{const ve=X.getTotalLength();if(!ve)return;const Re=ve*.2;X.style.strokeDasharray=`${ve-Re} ${Re}`;const He="triFlow_"+Math.random().toString(36).slice(2);ue=document.createElement("style"),ue.textContent=`@keyframes ${He}{from{stroke-dashoffset:0}to{stroke-dashoffset:-${ve}}}`,document.head.appendChild(ue),X.style.animation=`${He} 2.4s linear infinite`}catch{}});return()=>{cancelAnimationFrame(ee),ue?.remove()}},[H,l]),o.useEffect(()=>{me.current=$},[$]),o.useEffect(()=>{se.current=S},[S]),o.useEffect(()=>{const X=_.current,ue=A.current;if(!X||!ue)return;let ee=null;const ve=32,Re=60,He=()=>{try{const ft=Array.from(X.querySelectorAll(":scope > .button"));let be=0;ft.forEach(Ie=>{if(Ie===ue)return;const Ye=Ie.getBoundingClientRect();be+=Ye.width});const j=X.getBoundingClientRect().width,J=Math.max(0,Math.floor(j-be-8)),he=Je;if(!he||J<=0){Array.from(ue.children).forEach(Ie=>{try{Ie.style.width=""}catch{}});return}let De=Math.floor(J/he);De>Re&&(De=Re),De<ve&&(De=Math.max(ve,Math.floor(J/he))),Array.from(ue.querySelectorAll(".button")).forEach(Ie=>{try{Ie.style.width=`${De}px`}catch{}})}catch{}},tt=requestAnimationFrame(He);try{ee=new ResizeObserver(()=>{requestAnimationFrame(He)}),ee.observe(X),ee.observe(ue),window.addEventListener("resize",He)}catch{}return()=>{try{cancelAnimationFrame(tt)}catch{}try{ee&&(ee.disconnect(),ee=null)}catch{}try{window.removeEventListener("resize",He)}catch{}}},[$,z,Je]),o.useEffect(()=>()=>{try{Ae.current&&(clearTimeout(Ae.current),Ae.current=null),Ue.current&&(clearTimeout(Ue.current),Ue.current=null)}catch{}},[]);const en=(X,ue)=>{V(X),re(ue),mt(),Y(Mx(X)),me.current=X},Cn=()=>{O("playMode"),R(0),Z(!0)},jn=async(X,ue)=>{Ze(!1),y.current=!1,ot(X,ue),await Mc(X),await at()!==!1&&(N(!1),Cn(),await ct(X))},Wn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await fs(X,{timeoutMs:1e4,rejectOnError:!0});en([{src:X,objectUrl:null,duration:ve}],ve),P("ready"),ue&&ee&&await jn(ee,X)}finally{y.current=!1,N(!1)}},Hn=async(X,ue=!1)=>{const ee=C.current;N(!0),P("measuring_duration");try{const ve=await Promise.all(X.map(He=>fs(He,{timeoutMs:1e4})));if(!ge.current)return;const Re=X.map((He,tt)=>({src:He,objectUrl:null,duration:ve[tt]||0}));en(Re,Lx(Re)),P("ready"),ue&&ee&&Re.length>0&&await jn(ee,Re[0].src)}finally{y.current=!1,N(!1)}},qt=async(X=!1,ue=!0)=>{const ee=C.current,ve=t?Array.isArray(t)?t:[t]:[];if(!ve||ve.length===0||!ve.some(Boolean))return!1;if(y.current)return null;y.current=!0,ue&&N(!0),P("resolving");try{const Re=$x(t,a,yl),He=[];let tt=0;for(const ft of Re){let be=ft.src??null,j=null;if(!be&&ft.resolvedPath){try{P("getting_signed_url"),be=await vl(ft.resolvedPath)}catch{be=null}if(!ge.current)return!1;if(!be)try{P("downloading");const he=await xl(ft.resolvedPath);if(!ge.current)return!1;if(he){const De=he instanceof Blob?he:new Blob([he]);j=g.track(URL.createObjectURL(De)),be=j}}catch{P("error");try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4.")),O("active")}catch{}}}if(!be)continue;let J=0;try{P("measuring_duration"),J=await fs(be,{timeoutMs:3e3})}catch{J=0}if(!ge.current){if(j)try{URL.revokeObjectURL(j)}catch{}for(const he of He)if(he.objectUrl)try{URL.revokeObjectURL(he.objectUrl)}catch{}return!1}tt+=J||0,He.push({...ft,src:be,objectUrl:j,duration:J})}if(en(He,tt),He.length>0&&X&&ee){const ft=He[0];Ze(!1);try{g.keepOnly(He.map(be=>be.objectUrl))}catch{}if(P("ready"),y.current=!1,ft.src&&ee)try{if(ot(ee,ft.src),await Mc(ee),await at()===!1)return!1;ue&&N(!1),Cn(),ee&&await ct(ee)}catch{ue&&N(!1)}else ue&&N(!1);O("playMode"),R(0),Z(!0)}return He.length>0}finally{y.current=!1,ue&&N(!1),P(Re=>Re==="ready"?"ready":"idle")}},dn=async X=>{const ue=ce.isRunning();if(X.paused&&!ue){if(ke.current){await Lt();return}const ee=ce.resume();if(ee){if(T("playing"),ee.phase==="tail"){kt(ee.elapsed);return}await ct(X,3,50,ee.elapsed);return}await ct(X),T("playing")}else ce.pause(),Ve(),X.pause(),T("paused"),ue&&(We(),Ct())},Ut=async()=>{const X=C.current;if(!(!X&&!te)){if(te){const ue=window.speechSynthesis;if(H==="active"){const ee=Na(),ve=Array.isArray(s)?s.filter(Boolean):s?[s]:[];if(ee&&ve.length>0){if(y.current)return;O("load"),N(!0),P("synthesizing"),y.current=!0;try{const Re=await Promise.all(ve.map(He=>Promise.resolve(ee(He))));Re.length>1?await Hn(Re,!0):await Wn(Re[0],!0)}catch{y.current=!1,N(!1),O("active"),ht(ve.length>0?ve:void 0)}return}ht(ve.length>0?ve:void 0);return}if(H==="playMode"){const ee=!!ue&&(ue.speaking||ue.paused)&&!(X&&(X.currentSrc||X.getAttribute("src")));if(X&&!ee){await dn(X);return}try{if(ue&&ue.paused)try{Pe("tts"),ue.resume(),T("playing")}catch{}else try{ue.pause(),T("paused")}catch{}}catch{}}return}if(H==="active"){if(l&&Array.isArray(me.current)&&me.current.length>0){const ee=me.current[0];try{if(ee.src&&X)try{ot(X,ee.src),Cn(),X&&await ct(X)}catch{}Cn();return}catch{}}O("load");let ue;try{ue=await qt(!0)}catch{ue=!1}if(ue===!1&&ge.current){try{Ee(p("training.audioFetchError","\uC0AC\uC6B4\uB4DC \uC18C\uC2A4\uB97C \uAC00\uC838\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))}catch{}O("active")}return}if(H!=="load"&&(H==="playMode"||H==="active"))try{X&&await dn(X)}catch(ue){(ue instanceof Error||typeof ue=="object"&&ue&&"name"in ue)&&ue.name}}},Lt=async()=>{const X=C.current;if(X)try{const ue=me.current;if(Array.isArray(ue)&&ue.length>1){await Ft(0);return}Ze(!1);try{X.currentTime=0}catch{}X&&await ct(X),T("playing"),O("playMode")}catch{}},Tn=()=>{Ve(),nt(),it.current?.();const X=C.current;try{if(X){try{X.pause()}catch{}try{X.currentTime=0}catch{}}}catch{}Ct(),T("stopped"),O("active"),Q(0),Z(!1)},ln=async(X,{sameSegment:ue=!1}={})=>{Ve();const ee=ce.generation(),ve=C.current,Re=me.current?.[X]?.src;try{if(Ze(!1),R(X),Z(!0),se.current=X,!Re||!ve||(ue||mt(),ot(ve,Re),!ue&&await at()===!1)||!ce.isCurrent(ee)||(await ct(ve),!ce.isCurrent(ee)))return;T("playing"),O("playMode")}catch{}},Mn=async()=>{const X=me.current,ue=se.current||0;if(!X||ue<=0){await Lt();return}await ln(ue-1)},Ln=async()=>{const X=me.current,ue=se.current||0;if(!X||ue>=X.length-1){Tn();return}await ln(ue+1)},xn=()=>{if(ke.current)return;const X=200,ue=340;Ze(!0),Ve(),nt();try{Q(1)}catch{}dt(1);try{G("hold")}catch{}try{const ee=C.current,ve=te&&!!ee?.src;if(!te||ve){if(ee){ee.pause();try{ee.currentTime=0}catch{}}}else Bt();Ct()}catch{}try{T("stopped")}catch{}if(Z(!1),!qe.current)try{Ue.current&&(clearTimeout(Ue.current),Ue.current=null),Ue.current=setTimeout(()=>{try{G("out")}catch{}Ue.current=setTimeout(()=>{try{typeof we.current=="function"&&we.current(!0)}catch{}try{G("idle")}catch{}Ue.current=null},ue)},X)}catch{}};o.useEffect(()=>{yt.current=xn});const Gt=o.useCallback(()=>Ee(""),[]),Ft=async X=>{(me.current||[])[X]&&await ln(X,{sameSegment:X===se.current})},$t=K==="playing",pn=o.useMemo(()=>{if(!z||z.length<=1)return z;const X=z[S];return X?[X]:z},[z,S]),Ot=l===!0;o.useEffect(()=>{try{const X=C.current;X&&typeof X.playbackRate=="number"&&Ge(X)}catch{}},[oe,Ge]);const tn=o.useRef({raf:null,timer:null});o.useEffect(()=>{const X=C.current;if(!X)return;const ue=Math.max(0,Math.min(1,ie)),ee=tn.current,ve=()=>{ee.raf!==null&&(cancelAnimationFrame(ee.raf),ee.raf=null),ee.timer!==null&&(clearTimeout(ee.timer),ee.timer=null)};ve();const Re=tr(X);if(X.paused||Math.abs(Re-ue)<.001||typeof requestAnimationFrame!="function"){try{In(X,ue)}catch{}return}const He=performance.now(),tt=()=>{const ft=Math.min(1,(performance.now()-He)/150);try{In(X,Re+(ue-Re)*ft)}catch{}ee.raf=ft<1?requestAnimationFrame(tt):null};return ee.raf=requestAnimationFrame(tt),ee.timer=setTimeout(()=>{ve();try{In(X,ue)}catch{}},200),ve},[ie]);const Tt=q==="hold",Kt=q==="out",le=H==="playMode"&&!D&&!$e||Tt||Kt,Be=K!=="stopped"||Tt||Kt,Te=K==="paused",Ke=Math.max(0,Math.min(100,(L||0)*100)),Fe=_e("audio-player__fill",le?"is-visible":"",Be?"is-expanded":"",Te?"is-paused":"",Kt?"is-out":"");return n.jsxs("div",{className:`audio-player ${Ot?"is-disabled":""}${i?` ${i}`:""}`,role:"group","aria-label":typeof f=="string"?f:void 0,children:[n.jsxs("div",{className:`audio-player__panel ${$t?"is-playing":""} ${D?"is-loading":""} ${H!=="default"?"is-revealed":""}`,children:[D?n.jsxs("div",{className:"audio-player__loading",role:Tc[I]?"status":void 0,"aria-live":Tc[I]?"polite":"off",children:[n.jsx("span",{className:"audio-player__loading-spinner","aria-hidden":"true"}),n.jsx("span",{className:"audio-player__loading-text",children:p("training.audioStatus.preparing",{defaultValue:"\uC18C\uB9AC\uB97C \uC900\uBE44\uD558\uACE0 \uC788\uC2B5\uB2C8\uB2E4\u2026"})})]}):null,H==="active"?n.jsx("button",{className:"audio-player__button",type:"button",disabled:Ot,onClick:()=>{U.current=Cr(),E(),Ut()},"aria-label":typeof f=="string"?f:p("training.listen","\uB4E3\uAE30"),onMouseEnter:k,onMouseLeave:E,onFocus:k,onBlur:E,children:n.jsx("span",{ref:v,className:"audio-player__button-triangle-wrap",children:n.jsx("svg",{className:"audio-player__button-triangle",viewBox:"0 0 24 24","aria-hidden":"true",children:n.jsx("path",{ref:w,d:"M13.2 7.7 L16.5 9.85 Q20.2 12 16.5 14.15 L10 18.3 Q7 19.7 7 16.3 L7 7.7 Q7 4.3 10 5.7 L13.2 7.7"})})})}):null,B&&n.jsx(wn,{anchorRect:B,text:typeof f=="string"&&f?f:p("training.listenLabel","\uBB38\uC7A5 \uB4E3\uAE30"),offset:8}),n.jsxs("div",{className:`audio-player__play ${H==="playMode"||$t?"is-visible":""}`,inert:!(H==="playMode"||$t)||void 0,children:[n.jsxs("div",{ref:_,className:"audio-player__buttons",children:[n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-back",onClick:Mn,ariaLabel:p("training.prev","\uC774\uC804"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:$t?"pause":"play",onClick:Ut,ariaLabel:p("common.playPause","\uC7AC\uC0DD / \uBA48\uCDA4"),"aria-pressed":$t,width:"60px",variant:"transparent-white",disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"square",onClick:Tn,ariaLabel:p("training.stop","\uC815\uC9C0"),width:"60px",variant:"transparent-white","aria-hidden":"true",tabIndex:-1,disabled:H!=="playMode"}),Je>1?n.jsx("div",{ref:A,className:"audio-player__source-buttons",children:Array.from({length:Je}).map((X,ue)=>n.jsx(fe,{htmlType:"button",size:32,type:"dot",shape:"pill",useBorder:!1,label:String(ue+1),onClick:()=>{try{Ft(ue)}catch{}},ariaLabel:p("training.sourcePlay",{n:ue+1}),variant:"transparent-white",selected:F&&S===ue,disabled:H!=="playMode"||!(Array.isArray($)&&$[ue]),showTooltipInfo:!0},ue))}):null,!Array.isArray($)||$.length<=1?n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"repeat",onClick:Lt,ariaLabel:p("common.replay","\uB2E4\uC2DC\uB4E3\uAE30"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"}):null,n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"skip-forward",onClick:Ln,ariaLabel:p("training.next","\uB2E4\uC74C"),width:"60px",variant:"transparent-white","aria-hidden":!0,tabIndex:-1,disabled:H!=="playMode"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",shape:"pill",useBorder:!1,icon:"check",onClick:xn,ariaLabel:p("common.done","\uC644\uB8CC"),width:"60px",variant:"transparent-white",disabled:H!=="playMode"})]}),n.jsxs("div",{className:"audio-player__slider",children:[n.jsx("div",{className:Fe,ref:h,style:{left:`${Ke}%`},"aria-hidden":"true"}),(u||c)&&n.jsx(Ix,{segments:pn,progress:L,totalDuration:pe,waveProgressRef:Ce,showSoundWaveForm:u,leadInMs:d,tailMs:m,trackDurationSec:$?.[S]?.duration??0,noiseSrc:c&&b?.settings.enabled&&W>0?et:null,noiseRatio:b?Ja(b.settings):0,noiseSpeed:b?.settings.speed??1,mainVolume:ne,onReadyChange:lt})]})]}),n.jsx("audio",{ref:C,crossOrigin:"anonymous",preload:"auto"})]}),!u&&n.jsxs("p",{className:"audio-player__no-waveform caption-1",children:[n.jsx(Qe,{icon:"triangle-alert",size:14}),p("training.noSoundWaveform","\uC18C\uB9AC \uBE44\uAD50 \uBB38\uC81C\uB294 \uC6E8\uC774\uBE0C\uD3FC\uC744 \uD45C\uD604\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")]}),n.jsx(ha,{message:de,position:ye,onClose:Gt})]})}function kr(e){const{t}=xe.useTranslation(),{text:a,label:r,anchorRect:l=null,onClose:s,closeOnOutsideClick:i=!0,isMobilePopup:u=!1}=e||{},[c,d]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||"light"}catch{return"light"}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",c)}catch{}},[c]);const{increase:m,decrease:p,canIncrease:f,canDecrease:b,fontSize:x,lineHeight:C}=Mi({storageKey:"tooltip-fontScale"}),h=o.useCallback(()=>d(w=>w==="dark"?"light":"dark"),[]),_=o.useCallback(w=>{try{w.stopPropagation()}catch{}try{typeof s=="function"&&s()}catch{}},[s]),g=Array.isArray(a)?a:typeof a>"u"||a===null?[]:[a],A={fontSize:`${x}px`,lineHeight:`${C}px`,"--tt-line-height":`${C}px`,"--tt-marker-size":"28px"},y=n.jsxs("div",{className:`tooltip-textbox__root ${c==="dark"?"is-dark":""}`,children:[n.jsxs("div",{className:"tooltip-textbox__box",children:[r&&n.jsx("div",{className:"tooltip-textbox__label body-2b",children:r}),n.jsx("div",{className:"tooltip-textbox__text body-1",style:A,children:g.map((w,v)=>n.jsxs("div",{className:"tooltip-textbox__line",children:[g.length>1?n.jsx("div",{className:"tooltip-textbox__marker",children:n.jsx("span",{className:"tooltip-textbox__line-number button-1",children:v+1})}):null,n.jsx("span",{className:"tooltip-textbox__line-text",children:w})]},v))})]}),n.jsxs("div",{className:"tooltip-textbox__buttons",children:[n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"minus",onClick:p,ariaLabel:t("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!b}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"plus",onClick:m,ariaLabel:t("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),variant:c==="dark"?"transparent-white":"transparent-gray",disabled:!f}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:c==="dark"?"moon":"sun-medium",onClick:h,ariaLabel:t("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:c==="dark"?"transparent-white":"transparent-gray"}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:"x",onClick:_,ariaLabel:t("common.close","\uB2EB\uAE30"),variant:c==="dark"?"transparent-white":"transparent-gray"})]})]});return l?n.jsx(hn,{anchorRect:l,className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,onClose:s,closeOnOutsideClick:i,isMobilePopup:u,ariaLabel:r||t("tooltip.textbox","\uBCF8\uBB38"),children:y}):n.jsx("div",{className:`tooltip-textbox ${c==="dark"?"is-dark":""}`,children:y})}function $c({state:e="disabled"}){const{t}=xe.useTranslation();return n.jsxs("div",{className:`ts-bullet ts-bullet--${e}`,"aria-hidden":!0,children:[n.jsx("div",{className:"bullet__dot",children:n.jsx(Qe,{icon:"chevron-right",label:t("training.next","\uB2E4\uC74C"),className:"bullet__icon",imgClassName:"bullet__icon-img",maskClassName:"bullet__icon-mask",svgClassName:"bullet__icon-svg",wrapperStyle:{},size:20})}),n.jsx("div",{className:"ts-bullet__line"})]})}function Rc(e,t,a){const r=o.useRef(t),l=o.useRef(a);o.useEffect(()=>{r.current=t,l.current=a}),o.useEffect(()=>{if(!e||typeof document>"u")return;let s=null,i=10;const u=()=>{s=null;const c=r.current(),d=c?Array.from(c.querySelectorAll(gn)).find(m=>!m.closest('[aria-hidden="true"]')):void 0;if(d){try{d.focus()}catch{}if(document.activeElement===d)return}--i>0&&(s=requestAnimationFrame(u))};return s=requestAnimationFrame(u),()=>{s!==null&&cancelAnimationFrame(s);const c=document.activeElement;if(!c||c===document.body||!document.contains(c)||c.closest(".tooltip-content")){const d=l.current();if(d)try{d.focus()}catch{}}}},[e])}function Pc({title:e,children:t,className:a="",state:r="disabled",usePreviewTextBtn:l=!1,onPreviewTextBtn:s,previewText:i=null,useFaded:u,usePlayAllBtn:c=!1,onPlayAll:d,playAllActive:m=!1}){const{t:p}=xe.useTranslation(),f=un("(max-width: 767px)"),b=`training-step__title h4 ${u&&r==="disabled"?"training-step__title--faded":""} ${a}`.trim(),x=`training-step__title-row training-step__title-row--${r}`.trim(),C=o.useRef(null),[h,_]=o.useState(!1),[g,A]=o.useState(null),[y,w]=o.useState(null);Rc(h&&!!g,()=>{if(typeof document>"u")return null;const D=Array.from(document.querySelectorAll(".tooltip-content"));for(let N=D.length-1;N>=0;N--)if(D[N].querySelector(".tooltip-textbox__root"))return D[N];return null},()=>C.current?.querySelector("button")??null);const v=o.useRef(s);o.useEffect(()=>{v.current=s});const B=o.useMemo(()=>i==null?"":typeof i=="string"||typeof i=="number"?String(i):Array.isArray(i)&&i.every(D=>typeof D=="string"||typeof D=="number")?i.join(""):"",[i]),k=o.useCallback(()=>{_(!1),A(null),w(null)},[]);o.useEffect(()=>{if(!h)return;let D;try{typeof v.current=="function"&&(D=v.current())}catch{}if(D===!1){k();return}w(typeof D<"u"&&D!==null?D:null)},[B]);const E=o.useCallback(()=>{let D;try{typeof s=="function"&&(D=s())}catch{}if(D!==!1){if(w(typeof D<"u"&&D!==null?D:i),!C.current){_(N=>!N);return}if(h)_(!1),A(null),w(null);else{const N=C.current.getBoundingClientRect();A(N),_(!0)}}},[s,i,h]);return n.jsxs("div",{className:x,children:[n.jsx("p",{className:b,children:n.jsx("span",{className:"training-step__title-text",children:e??t})}),l||c?n.jsxs("div",{className:"title-controls",children:[n.jsxs("div",{className:"title-buttons",children:[c&&n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"play-circle",label:f?void 0:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),ariaLabel:p("training.playAll","\uBAA8\uB450 \uB4E3\uAE30"),selected:m,onClick:d,variant:r==="disabled"?"disabled":"default",disabled:r==="disabled"||m,onDisabledClick:m&&r!=="disabled"?()=>{}:void 0}),l&&n.jsx("div",{ref:C,children:n.jsx(fe,{htmlType:"button",size:32,type:f?"dot":"bar",icon:"eye",label:f?void 0:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),ariaLabel:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),onClick:E,className:h?"is-selected":void 0,"aria-expanded":h,"aria-haspopup":"dialog",variant:r==="disabled"?"disabled":"default",disabled:!i&&typeof s!="function"})})]}),h&&n.jsx(kr,{text:y??i,label:p("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),anchorRect:g,onClose:k,closeOnOutsideClick:!1,isMobilePopup:!0})]}):null]})}function gs(e,t){return typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled"}function ea({index:e,stepIndex:t,isLast:a=!1,title:r="",titleProps:l={},children:s,className:i="",onDone:u=void 0,useTitleFaded:c=void 0,lockedHint:d}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(()=>gs(e,t));o.useEffect(()=>{const v=gs(e,t);if(v!==p){const B=setTimeout(()=>f(v),0);return()=>clearTimeout(B)}},[e,t,p]);const b=o.useCallback((...v)=>{gs(e,t)==="done"||p==="done"||typeof u=="function"&&u(...v)},[e,t,p,u]),[x,C]=o.useState(!1),[h,_]=o.useState({text:"",label:"\uBB38\uC7A5 \uB4E3\uAE30",anchorRect:null,backdrop:!1,alignX:null,alignY:null}),g=o.useCallback(v=>{if(!v)return null;try{const B=v;if(typeof v=="object"&&(B.currentTarget||B.target)&&(B.nativeEvent||B.type)){const D=B.currentTarget??B.target;if(D&&typeof D.getBoundingClientRect=="function")return D.getBoundingClientRect()}if(v instanceof DOMRect)return v;const k=v;if(k&&typeof k.getBoundingClientRect=="function")return k.getBoundingClientRect();const E=v?.current;return E&&typeof E.getBoundingClientRect=="function"?E.getBoundingClientRect():null}catch{return null}},[]),A=o.useCallback((v,{text:B="",label:k="\uBB38\uC7A5 \uB4E3\uAE30",backdrop:E=!1,alignX:D="center",alignY:N="top"}={})=>{const I=g(v);_({text:B,label:k,anchorRect:I,backdrop:E,alignX:D,alignY:N}),C(!0)},[g]),y=o.useCallback(()=>{C(!1),_(v=>({...v,anchorRect:null}))},[]),w=o.Children.map(s,v=>{if(o.isValidElement(v)){const B=v;if(typeof B.type=="string")return B;const k=B.props??{},E=typeof k.onDone=="function"?k.onDone:b,D=typeof k.disabled=="boolean";let N=p==="disabled";return D&&(N=!!k.disabled),o.cloneElement(B,{onDone:E,disabled:N,showTooltip:A,hideTooltip:y})}return v});return n.jsxs("div",{className:`training-step training-step--${p} ${a?"training-step--last":""} ${i}`,"aria-current":p==="active",children:[n.jsx($c,{state:p}),n.jsxs("div",{className:"training-step__content",children:[n.jsx(Pc,{state:p,title:r,...l,useFaded:c}),p==="disabled"&&d&&typeof e=="number"&&typeof t=="number"&&e===t+1&&n.jsx("p",{className:"training-step__locked-hint caption-1",role:"status",children:d}),w]}),x?n.jsx(hn,{anchorRect:h.anchorRect,backdrop:h.backdrop,onClose:y,ariaLabel:m("tooltip.textbox","\uBCF8\uBB38"),children:n.jsx(kr,{text:h.text,onClose:y})}):null]})}function Ic({context:e,state:t="disabled",theme:a="light"}){const{t:r}=xe.useTranslation(),[l,s]=o.useState("disabled"),[i,u]=o.useState(()=>{try{return localStorage.getItem("tooltip-theme")||a}catch{return a}});o.useEffect(()=>{try{localStorage.setItem("tooltip-theme",i)}catch{}},[i]);const c=()=>u(P=>P==="dark"?"light":"dark"),{increase:d,decrease:m,canIncrease:p,canDecrease:f,fontSize:b,lineHeight:x}=Mi({storageKey:"textbox_fontScale"}),[C,h]=o.useState(""),_=o.useRef(null),g=o.useRef(!1),A=o.useCallback(()=>{g.current=Cr()&&!!_.current&&_.current.contains(document.activeElement),s("active")},[]),y=o.useCallback(()=>h(""),[]),w=P=>{try{h(P)}catch{}},v=typeof navigator<"u"&&/Mobi|Android/i.test(navigator.userAgent||"");o.useEffect(()=>{if(t!=="disabled"){const P=setTimeout(()=>s(t),0);return()=>clearTimeout(P)}},[t]);const B=o.useMemo(()=>e&&typeof e=="object"?String(e.sentence??e.text??""):typeof e=="string"?e:"",[e]),[k,E]=o.useState(B);k!==B&&(E(B),s("disabled"));const D=t==="disabled"?l:t,N=D==="disabled"?"training-text-box--disabled":D==="active"?"training-text-box--active":D==="done"?"training-text-box--done":"",I=o.useMemo(()=>({fontSize:`${b}px`,lineHeight:`${x}px`}),[b,x]);return o.useEffect(()=>{if(D==="disabled"||!g.current)return;g.current=!1;const P=document.activeElement;P&&P!==document.body||_.current?.querySelector(".training-text-box__buttons button")?.focus()},[D]),n.jsxs("div",{ref:_,className:`training-text-box ${N} ${D!=="disabled"&&i==="dark"?"is-dark":""}`,children:[D==="disabled"&&n.jsx("div",{className:"training-text-box__preview",children:n.jsx(fe,{htmlType:"button",size:48,type:"bar",onClick:A,icon:"eye",ariaLabel:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),label:r("training.sentencePreview","\uBB38\uC7A5 \uBBF8\uB9AC\uBCF4\uAE30"),useBorder:!1})}),n.jsx("div",{className:"training-text-box__area","aria-hidden":D==="disabled",children:n.jsx("span",{className:"training-text-box__inner h3",style:I,children:B})}),D!=="disabled"&&n.jsxs("div",{className:"training-text-box__buttons","aria-hidden":D==="disabled",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:m,onDisabledClick:()=>w(r("training.fontSizeMin","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uC18C\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeDecrease","\uAE00\uC790 \uD06C\uAE30 \uAC10\uC18C"),icon:"minus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!f,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:d,onDisabledClick:()=>w(r("training.fontSizeMax","\uAE00\uC528 \uD06C\uAE30\uAC00 \uCD5C\uB300\uC785\uB2C8\uB2E4.")),ariaLabel:r("training.fontSizeIncrease","\uAE00\uC790 \uD06C\uAE30 \uC99D\uAC00"),icon:"plus",variant:i==="dark"?"transparent-white":"transparent-gray",disabled:!p,useBorder:!1,showTooltipInfo:!0,...!v&&{width:"60px"}}),n.jsx(fe,{htmlType:"button",size:32,showTooltipInfo:!0,type:"dot",useBorder:!1,width:48,icon:i==="dark"?"moon":"sun-medium",onClick:c,ariaLabel:r("training.toggleBackground","\uBC30\uACBD \uC804\uD658"),variant:i==="dark"?"transparent-white":"transparent-gray"})]}),n.jsx(ha,{message:C,position:"top",onClose:y})]})}function ta(e){return e==="active"||e==="done"}function bs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,useTitleFaded:s,onDone:i,onChange:u,answer:c,wrongAnswers:d,choices:m,multiSelect:p=!1,correctCount:f=0,useDisabledCovered:b=!1,choiceIcons:x,shuffleChoices:C=!0}){const{t:h}=xe.useTranslation(),_=l??h("training.selectConfirm","\uBB38\uC81C\uB97C \uBCF4\uACE0 \uD574\uB2F9\uD558\uB294 \uB0B4\uC6A9\uC744 \uC120\uD0DD\uD558\uC138\uC694."),g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",y=Array.isArray(m)&&m.length?m:typeof c<"u"?[c].concat(Array.isArray(d)?d:[]):void 0,w=d?d.join("||"):"",v=m?m.join("||"):"",[B,k]=o.useState(()=>Array.isArray(y)?C?Ta(y):y.slice():void 0);o.useEffect(()=>{Array.isArray(y)&&y.length?k(C?Ta(y):y.slice()):k(void 0)},[c,w,v,C]);const[E,D]=o.useState(null),[N,I]=o.useState(()=>new Set);o.useEffect(()=>{D(null),I(new Set)},[v,c,w]);const P=o.useRef(void 0);o.useEffect(()=>{const M=P.current;typeof M=="number"&&typeof t=="number"&&typeof e=="number"&&M>=e&&t<e&&(D(null),I(new Set)),P.current=t},[t,e]);const K=o.useCallback(M=>{if(!ta(A))return;const L=B?.[M];if(L==null)return;const Q=L;if(p){const H=new Set(N);H.has(Q)?H.delete(Q):H.add(Q),I(H),typeof u=="function"&&u({selectedValues:[...H],__ts:Date.now()}),typeof i=="function"&&i({selectedValues:[...H],__ts:Date.now()})}else D(Q),typeof u=="function"&&u({selectedIndex:M,selectedValue:Q,__ts:Date.now()}),typeof i=="function"&&i({selectedIndex:M,selectedValue:Q,__ts:Date.now()})},[B,A,p,u,N]),T=`training-step__buttons${Array.isArray(B)&&B.length>3?" training-step__buttons--wrap-3":""}`;return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:_,useTitleFaded:s,children:n.jsx("div",{className:T,children:Array.isArray(B)&&B.length>0?B.map((M,L)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>K(L),ariaLabel:String(M),label:M,useLabel:!0,icon:x?x[String(M)]:void 0,variant:"default",disabled:A==="disabled",selected:p?N.has(M):E===M,useDisabledCovered:b,minWidth:0},String(M))):null})})}function ys({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u,demoSelected:c}){const{t:d}=xe.useTranslation(),m=l??d("training.confirmTitle","\uBB38\uC7A5\uC744 \uD655\uC778\uD558\uACE0 \uC798 \uB4E4\uB838\uB294\uC9C0 \uC120\uD0DD\uD558\uC138\uC694."),p=typeof e=="number"?e:-1,f=typeof t!="number"?"disabled":p<t?"done":p===t?"active":"disabled",b=u&&typeof u=="object"?u.sentence||"":typeof u=="string"?u:"",x=u&&typeof u=="object"?u.choices:void 0,[C,h]=o.useState(c??null),_=`${String(b)}\0${JSON.stringify(x??null)}`,[g,A]=o.useState(_);g!==_&&(A(_),c==null&&h(null));const[y,w]=o.useState(c);Object.is(y,c)||(w(c),h(c??null));const v=o.useRef(void 0);o.useEffect(()=>{const D=v.current;typeof D=="number"&&typeof t=="number"&&typeof e=="number"&&D>=e&&t<e&&c==null&&h(null),v.current=t},[t,e,c]);const B=o.useCallback(D=>{const N=typeof D=="object"&&D!==null?Object.assign({},D,{__ts:Date.now()}):{value:D,__ts:Date.now()};typeof i=="function"&&i(N),ta(f)&&typeof s=="function"&&s(N)},[i,f,s]),k=o.useCallback(()=>{ta(f)&&(h(!1),B(!1))},[B,f]),E=o.useCallback(()=>{ta(f)&&(h(!0),B(!0))},[B,f]);return n.jsxs(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:m,onDone:s,useTitleFaded:!1,children:[n.jsx(Ic,{context:u,state:f}),n.jsx("div",{className:"training-step__buttons",children:Array.isArray(x)&&x.length>0?x.slice(0,6).map((D,N)=>n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:()=>{ta(f)&&(h(N),B&&B(N))},disabled:f==="disabled",ariaLabel:String(D),label:D,variant:f,selected:C===N},N)):n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:k,disabled:f==="disabled",icon:"x",ariaLabel:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),label:d("training.notHeard","\uC548 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!1}),n.jsx(fe,{htmlType:"button",size:56,type:"bar",onClick:E,disabled:f==="disabled",icon:"circle",ariaLabel:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),label:d("training.heardWell","\uC798 \uB4E4\uB838\uC5B4\uC694."),variant:"default",selected:C===!0})]})})]})}function vs({index:e,stepIndex:t,isLast:a=!1,title:r,onDone:l,btnLabel:s,soundSrc:i,bucketPath:u,usePreviewTextBtn:c,previewText:d=null,onPreviewTextBtn:m,disabled:p,_pageIndex:f,showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:h}){const{t:_}=xe.useTranslation(),g=r??_("training.listenTitle","\uC81C\uC2DC\uD558\uB294 \uBB38\uC7A5\uC744 \uB4E4\uC5B4\uC8FC\uC138\uC694."),A=p??(typeof t=="number"&&typeof e=="number"?e>t:!1);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,title:g,onDone:l,titleProps:{usePreviewTextBtn:c,previewText:d,onPreviewTextBtn:m},children:n.jsx(Cs,{soundSrc:i,ttsText:i?null:d??g,bucketPath:u,btnLabel:s||_("training.listenButton","\uBB38\uC7A5 \uB4E3\uAE30"),disabled:A,className:"training-step__listen-sticky",showSoundWaveForm:b,showNoiseWaveForm:x,leadInMs:C,tailMs:h},`audio-p${f??0}-s${e}`)})}const Gx=[];function xs({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=Gx}){const{t:c}=xe.useTranslation(),d=l??c("training.orderListDefault","\uBB38\uC7A5\uC744 \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uBC30\uCE58\uD558\uC138\uC694."),m=Y=>typeof Y=="string"?Y:Y&&(Y.context||Y.sentence||Y.question||"")||"",[p,f]=o.useState(Array.isArray(u)?u:[]),[b,x]=o.useState(()=>(p||[]).map((Y,S)=>({id:S,text:m(Y)}))),C=o.useMemo(()=>typeof t!="number"||typeof e!="number"?"disabled":e<t?"done":e===t?"active":"disabled",[t,e]),h=C!=="disabled",_=o.useRef(void 0),g=o.useRef(void 0);o.useEffect(()=>{if(_.current===u)return;_.current=u;const Y=Array.isArray(u)?u:[];f(Y);const S=(R=>{const F=(R||[]).map((oe,ne)=>({id:ne,text:m(oe)}));if(F.length<=1)return F;const Z=(oe,ne)=>{if(oe.length!==ne.length)return!1;for(let W=0;W<oe.length;W++)if(oe[W].text!==ne[W].text)return!1;return!0};let pe=Ta(F),re=0;for(;Z(pe,F)&&re<20;)pe=Ta(F),re+=1;return pe})(Y);x(S);try{if(typeof i=="function"){const R=S.filter((F,Z)=>F.text===m(Y[Z])).length;i({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}if(typeof s=="function"&&C==="active"){const R=S.filter((F,Z)=>F.text===m(Y[Z])).length;g.current=u,s({shuffled:S,score:R,total:(Y||[]).length,initial:!0,__ts:Date.now()})}}catch{}},[u]),o.useEffect(()=>{if(C!=="active"||g.current===u||(g.current=u,typeof s!="function"))return;const Y=Array.isArray(u)?u:[],S=b.filter((R,F)=>R.text===m(Y[F])).length;s({shuffled:b,score:S,total:Y.length,initial:!0,__ts:Date.now()})},[C,u]);const A=(Y,S)=>{const R=[...b],F=Y+S;if(F<0||F>=R.length)return;const Z=R[F];R[F]=R[Y],R[Y]=Z,Q(R);try{if(typeof s=="function"&&C==="active"){const pe=R.filter((re,oe)=>re.text===m(p[oe])).length;s({shuffled:R,score:pe,total:(p||[]).length,__ts:Date.now()})}}catch{}},[y,w]=o.useState(null),v=o.useRef(null),B=o.useRef(null),k=o.useRef(null),E=o.useRef(null),D=o.useRef(null),N=o.useRef({x:0,y:0}),I=o.useRef(null),P=o.useRef({dx:0,dy:0}),K=()=>{if(I.current!==null)return;const Y=()=>{if(!v.current){I.current=null;return}I.current=requestAnimationFrame(Y);const S=N.current,R=P.current||{dx:0,dy:0};v.current&&(v.current.style.transform=`translate3d(${S.x-R.dx}px, ${S.y-R.dy}px, 0)`)};I.current=requestAnimationFrame(Y)},T=o.useRef(new Map),M=o.useRef(new Map),L=()=>{const Y=new Map;return T.current.forEach((S,R)=>{S&&S.getBoundingClientRect&&Y.set(R,S.getBoundingClientRect())}),Y},Q=Y=>{const S=L();x(Y);try{if(typeof i=="function"){const R=Y.filter((F,Z)=>F.text===m(p[Z])).length;i({shuffled:Y,score:R,total:(p||[]).length,__ts:Date.now()})}}catch{}requestAnimationFrame(()=>{const R=L();Y.forEach(F=>{const Z=S.get(F.id),pe=R.get(F.id),re=T.current.get(F.id);if(!re||!Z||!pe)return;const oe=Z.top-pe.top;oe&&(re.style.transition="none",re.style.transform=`translateY(${oe}px)`,requestAnimationFrame(()=>{re.style.transition="transform 420ms cubic-bezier(.22,.9,.39,1)",re.style.transform="";const ne=()=>{re.style.transition="",re.removeEventListener("transitionend",ne)};re.addEventListener("transitionend",ne)}))})})},H=(Y,S)=>{try{try{S.dataTransfer?.setData("text/plain",String(Y))}catch{}try{S.dataTransfer&&(S.dataTransfer.effectAllowed="move")}catch{}try{const R=document.createElement("div");R.style.cssText="position:absolute;top:-9999px;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none;",document.body.appendChild(R),S.dataTransfer?.setDragImage(R,0,0),requestAnimationFrame(()=>{try{document.body.removeChild(R)}catch{}})}catch{}}catch{}w(Y);try{const R=b[Y],F=document.createElement("div");F.className="order-list__dragging-object order-list__dragging-object--visible",F.textContent=R&&R.text?R.text:"",document.body.appendChild(F),v.current=F;const Z=T.current.get(R.id);let pe=S.clientX||0,re=S.clientY||0;try{if(Z&&Z.getBoundingClientRect){const G=Z.getBoundingClientRect();pe=G.left+G.width/2,re=G.top+G.height/2}}catch{}const oe=F.getBoundingClientRect(),ne=oe.width/2,W=oe.height/2;P.current={dx:ne,dy:W},F.style.transition="none",N.current={x:pe,y:re},F.style.transform=`translate3d(${pe-ne}px, ${re-W}px, 0)`,requestAnimationFrame(()=>{try{F.style.transition=""}catch{}K()});const ie=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};k.current=ie,document.addEventListener("mousemove",ie);const q=G=>{const de=G;N.current={x:de.clientX,y:de.clientY},K()};B.current=q,document.addEventListener("dragover",q);try{S.dataTransfer?.setData("text/plain",String(Y));try{S.dataTransfer?.setData("application/json",JSON.stringify({idx:Y}))}catch{}}catch{}}catch{}},O=(Y,S)=>{S.preventDefault();try{S.dataTransfer&&(S.dataTransfer.dropEffect="move")}catch{}try{D.current!==null&&(clearTimeout(D.current),D.current=null);const R=S.currentTarget&&S.currentTarget.closest?S.currentTarget.closest(".order-list__item"):null;if(R&&E.current!==R){if(E.current)try{E.current.classList.remove("drag-over")}catch{}try{R.classList.add("drag-over")}catch{}E.current=R}}catch{}},U=(Y,S)=>{S.preventDefault();const R=S.dataTransfer?.getData("text/plain")||"",F=R?parseInt(R,10):y,Z=Y;if(typeof F!="number"||isNaN(F)||F===Z){w(null),z(),$();return}const pe=CC(b,F,Z);Q(pe),w(null),$();try{if(typeof s=="function"&&C==="active"){const re=pe.filter((oe,ne)=>oe.text===m(p[ne])).length;s({shuffled:pe,score:re,total:(p||[]).length,__ts:Date.now()})}}catch{}try{requestAnimationFrame(()=>{const re=document.querySelectorAll(".order-list .order-list__item")[Z];if(!re)return;const oe=re.querySelector(".order-list__slot")||re;try{oe.classList.add("pulse"),oe.offsetHeight,oe.classList.add("to-dark");const ne=()=>{oe.classList.remove("pulse","to-dark"),oe.removeEventListener("transitionend",ne)};oe.addEventListener("transitionend",ne)}catch{}})}catch{}z()},$=()=>{if(v.current){try{document.body.removeChild(v.current)}catch{}v.current=null}B.current&&(document.removeEventListener("dragover",B.current),B.current=null),k.current&&(document.removeEventListener("mousemove",k.current),k.current=null),I.current!==null&&(cancelAnimationFrame(I.current),I.current=null)},V=()=>{w(null),z(),$()};o.useEffect(()=>()=>$(),[]);const z=()=>{try{if(D.current!==null&&(clearTimeout(D.current),D.current=null),E.current){try{E.current.classList.remove("drag-over")}catch{}E.current=null}document.querySelectorAll(".order-list .order-list__item").forEach(Y=>Y.classList.remove("drag-over"))}catch{}};return o.useEffect(()=>{try{const Y=Math.max(1,(b||[]).length);b.forEach((S,R)=>{const F=M.current.get(S.id);if(!F)return;let Z=50;Y>1&&(Z=Math.round(R/(Y-1)*100));try{F.style.setProperty("--marker-pos",Z+"%")}catch{}})}catch{}},[b]),o.useEffect(()=>()=>{$(),D.current!==null&&(clearTimeout(D.current),D.current=null)},[]),n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:d,children:n.jsx("div",{className:"order-list",children:b.map((Y,S)=>{const R=Math.max(1,(b||[]).length),F=R>1?Math.round(S/(R-1)*100):50;return n.jsx("div",{className:"order-list__item",children:n.jsxs("div",{className:"order-list__slot","data-disabled":C==="disabled","aria-disabled":C==="disabled",children:[C!=="disabled"?n.jsx("div",{className:"order-list__marker caption-1",style:{"--marker-pos":F+"%"},ref:Z=>{const pe=M.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},children:n.jsx("span",{className:"order-list__slot-number button-1",children:S+1})}):null,n.jsxs("div",{ref:Z=>{const pe=T.current;Z?pe.set(Y.id,Z):pe.delete(Y.id)},className:`order-list__draggable ${y===S?"dragging":""}`,"data-disabled":C==="disabled","aria-disabled":C==="disabled",tabIndex:C==="disabled"?-1:0,draggable:h,onDragStart:h?Z=>H(S,Z):void 0,onDragEnter:h?Z=>O(S,Z):void 0,onDragOver:h?Z=>O(S,Z):void 0,onDragLeave:h?()=>{try{D.current!==null&&clearTimeout(D.current),D.current=setTimeout(()=>{try{const Z=document.querySelectorAll(".order-list .order-list__item");Z&&Z[S]&&(Z[S].classList.remove("drag-over"),E.current===Z[S]&&(E.current=null))}catch{}},80)}catch{}}:void 0,onDrop:h?Z=>U(S,Z):void 0,onDragEnd:h?V:void 0,children:[n.jsx("span",{className:"order-list__item-text body-2",children:Y.text}),h?n.jsxs("span",{className:"order-list__item-buttons",children:[n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,-1),ariaLabel:c("training.up"),icon:"chevron-up",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===0,useBorder:!1,useDisabledInvisible:!0}),n.jsx(fe,{htmlType:"button",size:32,type:"dot",onClick:()=>A(S,1),ariaLabel:c("training.down"),icon:"chevron-down",variant:"transparent-gray",width:48,useFaded:"true",disabled:S===b.length-1,useBorder:!1,useDisabledInvisible:!0})]}):null]})]})},Y.id)})})})}const Kx=8e3;function Yx(e,t){return new Promise(a=>{let r=!1;const l=()=>{r||(r=!0,a())};e.then(l,l),setTimeout(l,t)})}function Fc({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,onDone:s,onChange:i,context:u=[],selectable:c=!1,hideLabel:d=!1,hideAudio:m=!1,maxCards:p,playAllGapMs:f=0}){const{t:b}=xe.useTranslation(),x=l??b("training.cardInstructions","\uB0B1\uB9D0 \uCE74\uB4DC\uB97C \uBCF4\uACE0 \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uD655\uC778\uD558\uC138\uC694."),C=o.useMemo(()=>Array.isArray(u)?u:u&&u.items||[],[u]),h=p??3,_=(C||[]).slice(0,h);(C||[]).length>h&&console.warn(`TrainingStepCard: ${C.length} items passed but only ${h} shown`);const g=typeof e=="number"?e:-1,A=typeof t!="number"?"disabled":g<t?"done":g===t?"active":"disabled",[y,w]=o.useState(null),v=o.useRef([]),[B,k]=o.useState(!1),E=o.useRef(null),D=o.useRef(!0);o.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const N=o.useMemo(()=>C.map(L=>L?.id??L?.word??"").join("|"),[C]);o.useEffect(()=>{w(null)},[N]);const I=o.useRef(void 0);o.useEffect(()=>{const L=I.current;typeof L=="number"&&typeof t=="number"&&typeof e=="number"&&L>=e&&t<e&&w(null),I.current=t},[t,e]);const P=o.useCallback((L,Q)=>{if(c)return;const H={item:L,index:Q,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(A==="active"&&typeof s=="function")try{s(H)}catch{}},[c,i,A,s]),K=o.useRef(f);o.useEffect(()=>{K.current=Math.max(0,f||0)},[f]);const T=o.useCallback(async()=>{if(B||A==="disabled")return;k(!0);let L=!1;const Q=new Promise(H=>{E.current=()=>{L=!0,H()}});try{for(let H=0;H<_.length&&!(!D.current||L);H++){const O=v.current[H];if(!O)continue;await Promise.race([Yx(O.play(),Kx),Q]);const U=Math.max(0,K.current||0);U>0&&H<_.length-1&&!L&&D.current&&await Promise.race([new Promise($=>{setTimeout($,U)}),Q])}}finally{E.current=null,k(!1)}},[B,A,_.length]),M=o.useCallback((L,Q)=>{if(!ta(A))return;w(Q);const H={selectedValue:L.word||L.title||"",selectedIndex:Q,item:L,__ts:Date.now()};try{typeof i=="function"&&i(H)}catch{}if(typeof s=="function")try{s(H)}catch{}},[i,A,s]);return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:x,onDone:s,titleProps:{usePlayAllBtn:!m&&_.length>0,onPlayAll:T,playAllActive:B},children:n.jsx("div",{className:"training-step__cards",onClickCapture:L=>{const Q=E.current;if(!Q)return;const H=L.target;H&&typeof H.closest=="function"&&H.closest(".training-word-card__bottom")&&Q()},children:_.length===0?n.jsx("div",{className:"training-step__empty",children:b("training.noCards","\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}):_.map((L,Q)=>n.jsx(Jo,{ref:H=>{v.current[Q]=H},item:L,disabled:A==="disabled",onPlayDone:()=>P(L,Q),selectable:c,selected:c&&y===Q,onSelect:c?()=>M(L,Q):void 0,flipDelay:Q*120,hideLabel:d,hideAudio:m},L&&L.id||Q))})})}const Zx=160,Oc=()=>{};function Dn(e){const t=o.useId();if(!("variant"in e)){const{label:g,sub:A,onClick:y,children:w,align:v="horizontal",icon:B,useFullWidth:k=!1}=e,E=D=>{y&&D.target===D.currentTarget&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),y())};return n.jsxs("div",{className:_e("panel-row",v==="vertical"?"panel-row--vertical":"",k?"panel-row--label-fixed panel-row--fill":"",y?"panel-row--clickable":""),onClick:y,onKeyDown:y?E:void 0,role:y?"button":void 0,tabIndex:y?0:void 0,children:[B!=null&&n.jsx("div",{className:"panel-row__icon",children:B}),g!=null&&n.jsxs("div",{className:"panel-row__left",children:[n.jsx("div",{className:"panel-row__label body-3",children:g}),A&&n.jsx("div",{className:"panel-row__sub caption-1",children:A})]}),n.jsx("div",{className:"panel-row__right",children:w})]})}if(e.variant==="description")return n.jsx("div",{className:"panel-row panel-row--block",children:n.jsx("p",{className:"panel-row__description body-3",children:e.children})});if(e.variant==="empty")return n.jsx("div",{className:"panel-row panel-row--empty body-3",children:e.children});if(e.variant==="loading")return n.jsx("div",{className:"panel-row panel-row--loading",children:n.jsx(Ga,{size:28})});if(e.variant==="custom"&&!e.label)return n.jsx("div",{className:"panel-row panel-row--block",children:e.children});const{variant:a,label:r,sub:l,onClick:s,required:i,error:u,align:c="horizontal",useFullWidth:d=!1,icon:m}=e,p=a==="button"?void 0:s;let f=null;const b=a==="toggle"?`panel-toggle-${t}`:void 0,x=u?`panel-error-${t}`:void 0,C=`panel-helper-${t}`;if(a==="toggle"){const g=e;f=n.jsx(vu,{checked:g.checked,onChange:g.onChange,id:b})}else if(a==="segmented"){const g=e;f=n.jsx(bn,{options:g.options,value:g.value,onChange:g.onChange,size:g.size??40,ariaLabel:r})}else if(a==="dropdown"){const g=e,A=g.dropdowns?.length?n.jsx("div",{className:`panel-row__dropdown-group${d?" panel-row__dropdown-group--full":""}`,children:g.dropdowns.map((y,w)=>n.jsx("div",{className:d?"panel-row__dropdown-item--full":void 0,children:n.jsx(cn,{options:y.options,value:y.value,onChange:y.onChange,placeholder:y.placeholder,block:d,error:!!u,ariaDescribedBy:x,ariaLabel:y.ariaLabel??([r,y.placeholder].filter(Boolean).join(" ")||void 0)})},w))}):n.jsx(cn,{options:g.options??[],value:g.value??"",onChange:g.onChange??Oc,block:d,error:!!u,ariaLabel:r,ariaDescribedBy:x});f=u?n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[A,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}):A}else if(a==="button"){const g=e;g.buttons?.length?f=n.jsx("div",{className:"panel-row__button-group",children:g.buttons.map((A,y)=>n.jsx(fe,{htmlType:"button",size:A.btnSize??40,variant:A.btnVariant??"default",disabled:A.disabled,onClick:A.onClick,children:A.label},y))}):f=n.jsx(fe,{htmlType:"button",size:g.btnSize??40,variant:g.btnVariant??"default",disabled:g.disabled,onClick:g.onClick,children:g.buttonLabel})}else if(a==="text"){const g=e;f=n.jsx("span",{className:`panel-row__text body-2${d?" panel-row__text--full":""}`,style:g.valueColor?{color:g.valueColor}:void 0,children:g.value})}else if(a==="input"){const g=e;f=n.jsxs("div",{className:`panel-row__input-wrap${d?" panel-row__input-wrap--full":""}`,children:[n.jsx(Xn,{value:g.value,onChange:g.onChange??Oc,onKeyDown:g.onKeyDown,onEnter:g.onEnter,placeholder:g.placeholder,ghostText:g.ghostText,inputMode:g.inputMode,readOnly:g.readOnly,disabled:g.disabled,type:g.type,autoComplete:g.autoComplete,maxLength:g.maxLength,showCount:g.showCount,multiline:g.multiline,rows:g.rows,fullWidth:d,error:u,ariaLabel:r,required:i,ariaDescribedBy:g.helperText?C:void 0}),g.helperText&&n.jsx("div",{id:C,className:"panel-row__helper caption-1",children:g.helperText})]})}else a==="custom"&&(f=e.children);u&&a!=="input"&&a!=="dropdown"&&(f=n.jsxs("div",{className:`panel-row__dropdown-error-wrap${d?" panel-row__dropdown-error-wrap--full":""}`,children:[f,n.jsx("span",{id:x,className:"caption-1 panel-row__error",role:"alert",children:u})]}));const h=a==="input"||a==="dropdown"||(a==="text"||a==="custom")&&d,_=g=>{p&&g.target===g.currentTarget&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p())};return n.jsxs("div",{className:_e("panel-row",c==="vertical"?"panel-row--vertical":"",h?"panel-row--label-fixed":"",a==="text"?"panel-row--text":"",p?"panel-row--clickable":""),onClick:p,onKeyDown:p?_:void 0,role:p?"button":void 0,tabIndex:p?0:void 0,children:[m!=null&&n.jsx("div",{className:"panel-row__icon",children:m}),n.jsxs("div",{className:"panel-row__left",children:[b?n.jsxs("label",{htmlFor:b,className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}):n.jsxs("div",{className:"panel-row__label body-3",children:[r,i&&n.jsx("span",{className:"required-mark",children:"*"})]}),l&&n.jsx("div",{className:"panel-row__sub caption-1",children:l})]}),n.jsx("div",{className:"panel-row__right",children:f})]})}function zc(e){const t=e.productName||e.brand,a=[e.brand,e.fitType].filter(r=>!!r&&r!==t);return[...new Set(a)].join(" \xB7 ")}function Xx({devices:e,onRelease:t,emptyLabel:a}){const{t:r,i18n:l}=xe.useTranslation();return n.jsx("div",{className:"panel-row panel-row--device",children:["left","right"].map(s=>{const i=e[s],u=s==="left"?r("device.direction.left","\uC88C"):r("device.direction.right","\uC6B0");return n.jsxs("div",{className:"panel-row__device-column",children:[n.jsxs("div",{className:"panel-row__device-head",children:[n.jsx("span",{className:"panel-row__device-side body-2b",children:u}),i&&t&&n.jsx(fe,{htmlType:"button",size:32,type:"dot",icon:"x",ariaLabel:`${u} ${r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C")}`,showTooltipInfo:r("customers.device.unwear","\uCC29\uC6A9 \uD574\uC81C"),onClick:()=>t(s)})]}),i?n.jsxs("div",{className:"panel-row__device-info",children:[n.jsxs("span",{className:"panel-row__device-kind",children:[i.device&&n.jsx(Et,{size:"small",variant:Ou(i.device),fill:"soft",label:zu(i.device,r)}),zc(i)&&n.jsx("span",{className:"panel-row__device-detail body-3",children:zc(i)})]}),n.jsx("span",{className:"panel-row__device-name body-2b",children:i.productName||i.brand}),Yo(i.wornYear,i.wornMonth,i.wornDay,l.language)&&n.jsx("span",{className:"panel-row__device-date caption-1",children:r("customers.device.wornSince",{date:Yo(i.wornYear,i.wornMonth,i.wornDay,l.language)})})]}):n.jsx("span",{className:"panel-row__device-empty body-3",children:a??r("customers.device.notRegistered","\uBBF8\uB4F1\uB85D")})]},s)})})}function Ar({title:e,titleLevel:t=2,icon:a,disc:r,actions:l,size:s="medium",minHeight:i,maxWidth:u,className:c,scrollable:d,scrollbarGutter:m="auto",compactRows:p=!1,useBorder:f=!0,useBg:b=!0,useRowBorder:x=!0,labelWidth:C,form:h=!1,loading:_,empty:g,children:A}){const y=_e("panel",`panel--${s}`,h?"panel--form":"",i!==void 0?"panel--fill":"",f?"":"panel--no-border",b?"":"panel--no-bg",x?"":"panel--no-row-border",p?"panel--compact-rows":"",c),w={};i!==void 0&&(w.minHeight=i),u!==void 0&&(w.maxWidth=typeof u=="number"?`${u}px`:u),C!==void 0&&(w["--panel-label-width"]=typeof C=="number"?`${C}px`:C);const v=t?`h${t}`:"div";return n.jsxs("div",{className:y,style:Object.keys(w).length?w:void 0,children:[(!!e||r!=null)&&n.jsxs("div",{className:_e("panel__header",r!=null?"panel__header--with-disc":""),children:[a&&n.jsx(Qe,{icon:a,label:typeof e=="string"?e:void 0,className:"panel__icon"}),n.jsxs("div",{className:"panel__title-group",children:[!!e&&n.jsx(v,{className:`panel__title ${r!=null?"body-3b":"h5b"}`,children:e}),r!=null&&n.jsx("p",{className:"panel__disc caption-1",children:r})]}),l&&n.jsx("div",{className:"panel__actions",children:l})]}),_?n.jsx(Dn,{variant:"loading"}):g!=null&&o.Children.toArray(A).length===0?n.jsx(Dn,{variant:"empty",children:g}):d?n.jsx("div",{className:_e("panel__body--scroll",m==="stable"&&"panel__body--gutter-stable"),children:A}):A]})}function Jx({cols:e=2,layout:t="grid",gap:a=1,collapseAt:r,className:l,style:s,children:i}){const u=o.useRef(null),[c,d]=o.useState();o.useEffect(()=>{const p=u.current;if(r===void 0||!p||(d(p.clientWidth),typeof ResizeObserver>"u"))return;const f=new ResizeObserver(([b])=>d(b.contentRect.width));return f.observe(p),()=>f.disconnect()},[r]);const m=r!==void 0&&c!==void 0&&c<=r;return n.jsx("div",{ref:u,className:_e("panel-grid",t==="columns"&&"panel-grid--columns",l),style:{"--panel-grid-cols":m?1:e,"--panel-grid-gap":typeof a=="number"?`${a}px`:a,...s},children:i})}function Qx(e){return[{label:e("training.noise.level.none","\uC5C6\uC74C"),value:0},{label:e("training.noise.level.weak","\uC57D\uD568"),value:1},{label:e("training.noise.level.medium","\uBCF4\uD1B5"),value:2},{label:e("training.noise.level.strong","\uAC15\uD568"),value:3},{label:e("training.noise.level.veryStrong","\uB9E4\uC6B0 \uAC15\uD568"),value:4}]}function Wc(e){return[{label:e("training.noise.type.default","\uAE30\uBCF8"),value:"defaultNoise",icon:"party-popper"},{label:e("training.noise.type.street","\uAE38\uAC70\uB9AC"),value:"street",icon:"car"},{label:e("training.noise.type.buzz","\uC640\uAE00\uC640\uAE00"),value:"buzz",icon:"message-square-more"},{label:e("training.noise.type.restaurant","\uC2DD\uB2F9"),value:"restaurant",icon:"coffee"}]}Qx(Rt.t.bind(Rt)),Wc(Rt.t.bind(Rt));const Nr="none",e_=.5,t_=1.5,n_=.25;function _s({title:e,valueLabel:t,value:a,min:r,max:l,step:s,tickStep:i,size:u,disabled:c,onChange:d}){return n.jsxs(Dn,{variant:"custom",label:e,useFullWidth:!0,children:[n.jsx(Lu,{value:a,onChange:d,min:r,max:l,step:s,size:u,showBgTick:!0,tickStep:i,ariaLabel:e,disabled:c,className:"noise-settings__slider-input"}),n.jsx("div",{className:_e("noise-settings__value","button-1",c?"noise-settings__value--disabled":""),children:t})]})}function Hc({anchorRect:e,onClose:t,hideNoiseRows:a=!1}){const{t:r}=xe.useTranslation(),l=un("(max-width: 767px)")?40:24,s=xr(),i=Ja(s?.settings??Qn),u=s?.settings.type??"defaultNoise",c=s?.settings.enabled??!0,d=s?.playbackRate??1,m=s?.mainVolume??1,p=Math.round(m*100),f=o.useCallback(_=>{try{s?.setMainVolume(Math.max(0,Math.min(1,_/100)))}catch{}},[s]),b=o.useCallback(_=>{try{s?.setPlaybackRate(_)}catch{}},[s]),x=o.useCallback(_=>{const g=Math.min(Xa,Math.max(0,Math.round(_*10)/10));try{s?.setSettings({noiseRatio:g})}catch{}},[s]),C=o.useCallback(_=>{try{_===Nr?s?.setSettings({enabled:!1}):s?.setSettings({type:_,enabled:!0})}catch{}},[s]),h=[{key:Nr,label:r("training.noise.type.none","\uC5C6\uC74C")},...Wc(r).map(_=>({key:_.value,label:_.label}))];return n.jsx(hn,{anchorRect:e,offset:12,onClose:t,ariaLabel:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),isMobilePopup:!1,closeOnOutsideClick:!1,header:n.jsxs("div",{className:"noise-settings__header",children:[n.jsx("span",{children:r("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815")}),n.jsx(fe,{htmlType:"button",size:40,type:"dot",icon:"x",variant:"transparent-gray",useBorder:!1,ariaLabel:r("common.close","\uB2EB\uAE30"),onClick:t})]}),children:n.jsxs(Ar,{className:"noise-settings",useBorder:!1,labelWidth:72,children:[n.jsx(_s,{title:r("training.playVolumeTitle","\uC804\uCCB4 \uC18C\uB9AC"),valueLabel:`${p}%`,value:p,min:0,max:100,step:10,size:l,onChange:f}),n.jsx(_s,{title:r("training.playSpeedTitle","\uC7AC\uC0DD \uC18D\uB3C4"),valueLabel:`${d.toFixed(2)}x`,value:d,min:e_,max:t_,step:n_,size:l,onChange:b}),!a&&n.jsxs(n.Fragment,{children:[n.jsx(Dn,{variant:"custom",label:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),useFullWidth:!0,children:n.jsx(bn,{ariaLabel:r("training.noiseTypeTitle","\uC18C\uC74C \uC885\uB958"),size:40,shape:"rounded",options:h,value:c?u:Nr,onChange:C})}),n.jsx(_s,{title:r("training.noiseRatioTitle","\uC18C\uC74C \uBE44\uC728"),valueLabel:r("training.noiseRatioValue","{{ratio}}\uBC30",{ratio:i.toFixed(1)}),value:i,min:0,max:Xa,step:_c,size:l,disabled:!c,onChange:x})]}),a&&n.jsx("div",{className:"noise-settings__width-ghost","aria-hidden":"true",inert:!0,children:n.jsx(Dn,{variant:"custom",label:"\xA0",useFullWidth:!0,children:n.jsx(bn,{ariaLabel:"width-ghost",size:40,shape:"rounded",options:h,value:Nr,onChange:()=>{}})})})]})})}function Vc({useNoiseSettingBtn:e=!1,onSettings:t,onNext:a,onResult:r,stepIndex:l=0,stepCount:s=0,pageIndex:i=0,pageCount:u=1,resultOpen:c=!1,hideNoiseRows:d=!1}){const{t:m}=xe.useTranslation(),[p,f]=o.useState(!1),[b,x]=o.useState(null),[C,h]=o.useState(!1),_=o.useRef(null),g=o.useRef(null),A=xr(),y=u>0,w=y&&i<u-1,v=!y||i>=u-1,B=l===Math.max(0,s);o.useEffect(()=>{e||(f(!1),x(null))},[e]);const k=o.useCallback(()=>{f(!1),x(null)},[]),E=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=_?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),D=o.useCallback(()=>{if(p){f(!1),x(null);return}const Q=g?.current?.getBoundingClientRect();Q&&x(Q),t?.(),f(!0)},[p,t]),N=un("(max-width: 767px)"),I=o.useRef(null),[P,K]=o.useState(null),T=o.useCallback(()=>{h(Q=>{const H=!Q;return K(H?I.current?.getBoundingClientRect()??null:null),H})},[]),M=o.useCallback(()=>{h(!1),K(null)},[]);o.useEffect(()=>{c&&(h(!1),K(null))},[c]);const L=n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.sentence","\uC7AC\uC0DD")}),n.jsx(Uo,{analyser:A?.mainAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.sentence","\uC7AC\uC0DD")})]}),n.jsxs("div",{className:"pp-bottom__meter",children:[n.jsx("span",{className:"pp-bottom__meter-label caption-1",children:m("training.meter.noise","\uC18C\uC74C")}),n.jsx(Uo,{analyser:A?.noiseAnalyser??null,orientation:"horizontal",length:112,label:"db",labelPos:"left",ariaLabel:m("training.meter.noise","\uC18C\uC74C")})]})]});return Rc(e&&p,()=>typeof document<"u"?document.querySelector(".noise-settings__header")?.closest(".tooltip-content")??null:null,()=>[_.current,g.current].map(Q=>Q?.querySelector("button")??null).find(Q=>!!Q&&Q.getClientRects().length>0)??_.current?.querySelector("button")??null),n.jsxs("div",{className:"pp-bottom",children:[n.jsxs("div",{className:"pp-bottom__left",children:[e?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pp-bottom__settings--desktop",children:n.jsx("div",{ref:_,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:56,type:"bar",icon:"settings",onClick:E,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),label:m("training.trainingSettingsTitle","\uD6C8\uB828 \uC124\uC815"),minWidth:140})})}),n.jsx("div",{className:"pp-bottom__settings--mobile",children:n.jsx("div",{ref:g,className:"pp-bottom__tooltip-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:56,type:"dot",shape:"pill",icon:"settings",onClick:D,className:p?"is-selected":void 0,"aria-expanded":p,"aria-haspopup":"dialog",ariaLabel:m("training.settings","\uC124\uC815")})})})]}):null,e&&n.jsx("div",{ref:I,className:"pp-bottom__meter-trigger","data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:"dot",shape:"pill",icon:"audio-lines",onClick:T,selected:C,"aria-expanded":N?C:void 0,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC")})}),e&&C&&!N&&n.jsx("div",{className:"pp-bottom__meters",children:L})]}),e&&C&&N&&P&&n.jsx(hn,{anchorRect:P,onClose:M,ariaLabel:m("training.meter.toggle","\uC624\uB514\uC624 \uBBF8\uD130 \uD45C\uC2DC"),children:n.jsx("div",{className:"pp-bottom__meters pp-bottom__meters--floating",children:L})}),n.jsxs("div",{className:"pp-bottom__right",children:[v&&n.jsx(fe,{htmlType:"button",size:56,type:"bar",icon:"check",onClick:typeof r=="function"?r:a,ariaLabel:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),label:m("training.viewResult","\uACB0\uACFC\uBCF4\uAE30"),variant:"main",disabled:!B}),w&&n.jsx(fe,{htmlType:"button",size:56,type:"bar",rightIcon:"chevron-right",align:"right",onClick:a,ariaLabel:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),label:m("training.nextQuestion","\uB2E4\uC74C \uBB38\uC81C"),variant:"main",disabled:!B})]}),e&&p&&n.jsx(Hc,{anchorRect:b,onClose:k,hideNoiseRows:d})]})}function qc({title:e,subtitle:t,desc:a,depth:r,icon:l,wrapperStyle:s,iconTooltip:i,pageIndex:u,pageCount:c,progressMax:d,progressIndex:m,onBack:p,onClose:f}){const{t:b}=xe.useTranslation(),x=un("(max-width: 767px)"),C=Number.isInteger(m)?m:u||0,h=Number.isInteger(d)?d:c||0,_=p||f,g=Array.isArray(r)?x?r[r.length-1]:r.join(" / "):r,A=typeof e=="string"?e.trim():e,y=typeof t=="string"?t.trim():t,w=!!(A||y),v=w?A||y:b("common.emptyTrainingName","\uD6C8\uB828 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),B=g||(A?t:void 0),k=x&&typeof B=="string"&&(B.includes(" \xB7 ")||B.includes(" / "))?B.split(/\s[·/]\s/).pop():B,E=o.useMemo(()=>{const D=s&&typeof s=="object"?{...s}:{};return!("width"in D)&&!("height"in D)&&(D.width="40px",D.height="40px"),D},[s]);return n.jsxs("header",{className:"pp-title training-popup-title",children:[n.jsxs("div",{className:"pp-title__left",children:[_?n.jsx(fe,{htmlType:"button",size:48,type:"dot",icon:"chevron-left",ariaLabel:b("common.back","\uB4A4\uB85C"),onClick:_,useBorder:!1,iconSize:"large",iconColor:"--color-black",variant:"transparent-gray"}):null,n.jsx("div",{children:l?n.jsx(du,{icon:l,label:e,tooltip:i,wrapperStyle:E}):null}),n.jsxs("div",{className:"pp-title__text",children:[k?n.jsx("span",{className:"pp-title__depth caption-1",children:k}):null,n.jsx("span",{className:`pp-title__title h2${w?"":" pp-title__title--empty"}`,children:v}),a?n.jsx("span",{className:"pp-title__description caption-1",children:a}):null]})]}),n.jsx(Iu,{max:Math.max(0,h??0),index:Math.max(0,C??0)})]})}function a_(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("speechear.popup.close"))}function r_(e){return!e&&e!==0?[]:Array.isArray(e)?e.flatMap(t=>typeof t=="string"?t.split("|").map(a=>a.trim()).filter(Boolean):t||t===0?[String(t)]:[]):typeof e=="string"?e.split("|").map(t=>t.trim()).filter(Boolean):[String(e)]}const Uc=(e,t)=>{if(!t)return t;const a=typeof Rt?.t=="function"?Rt.t(e,{defaultValue:t}):void 0;return typeof a=="string"&&a?a:t};function Gc(e,t,a){const r=e,l=r?.title||r?.name||(Array.isArray(t)?t[t.length-1]:void 0)||a||"\uD6C8\uB828",s=ql().find(u=>u.key===(r?.category_0||r?.category_main_code)),i=s?.subs?.find(u=>u.key===(r?.category_1||r?.category_sub_code));return{title:l,label:r?.title||l,depth:t,icon:s?.icon,wrapperStyle:s?.color?{"--t-item-fg":s.color}:void 0,iconTooltip:[s?Uc(`topic.${s.key}`,s.label):void 0,i?Uc(`topic.sub.${i.key}`,i.label):void 0].filter(Boolean).join(" / ")||void 0}}function ws(e){return e&&typeof e=="object"&&typeof e.__ts=="number"?e.__ts:0}function Kc(e,t,a){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e,l=typeof a=="number"&&a>0?a:Date.now();return{...r,...r.shownAt===void 0&&t?{shownAt:t}:{},...r.answeredAt===void 0?{answeredAt:new Date(l).toISOString()}:{}}}function o_(e){const t=e;return Array.isArray(t?.items)?t.items:Array.isArray(e)?e:e?[e]:[]}function s_({idPrefix:e,trainingData:t,depth:a,fallbackTitle:r="\uD6C8\uB828",pages:l=[],emptyMessage:s,buildResults:i,metaPatch:u}){const c=Gc(t,a,r),d=typeof u=="function"?u(c)||{}:u||{},m=t?.id||t?.title||l.length;return{id:`${e}:${m}`,meta:{...c,...d},pages:l,emptyMessage:s,buildResults:i}}function l_(e){if(typeof e=="string")return e;if(e&&typeof e=="object"){const t=e;return t.context||t.sentence||t.question||""||""}return""}function i_(e){if(e&&typeof e=="object"){const t=e;if(Array.isArray(t.selectedValues))return t.selectedValues;if(t.selectedValue!==void 0)return t.selectedValue;if(t.selectedIndex!==void 0)return t.selectedIndex;if(t.value!==void 0)return t.value}return e}function u_(e,t=[]){if(Array.isArray(e))return e.join(", ");if(typeof e=="number"&&Array.isArray(t))return String(t[e]??"");if(typeof e=="string")return e}function Yc(e,t){if(!(!e||typeof e!="object"))return e[`step-${t}`]}function c_(e,t,a,r){return Yc(e,t*a+r)}function d_({payload:e,selected:t,choices:a=[],correctAnswers:r=[]}){if(e&&typeof e=="object"){const l=e;if(Array.isArray(l.selectedValues))return r.every(s=>l.selectedValues.includes(s))&&l.selectedValues.every(s=>r.includes(s));if(typeof l.correct=="boolean")return l.correct}if(r.length){if(typeof t=="number"&&Array.isArray(a)&&a.length)return r.some(l=>String(l)===String(a[t]));if(typeof t<"u")return r.some(l=>String(l)===String(t))}}function p_(e){return e?Array.isArray(e.items)?e.items.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.context||a.sentence||"",contextCode:a.contextCode||a.context_code}}):Array.isArray(e.sentences)?e.sentences.map(t=>{const a=t;return typeof t=="string"?{sentence:t}:{sentence:a.sentence||a.context||"",contextCode:a.contextCode}}):Array.isArray(e.contexts)?e.contexts:e.contextCode?[{contextCode:e.contextCode}]:[]:[]}const Zc=o.createContext(null);function m_(){const e=o.useContext(Zc);if(!e)throw new Error("useTrainingPagePopupContext must be used inside TrainingPagePopup");return e}function h_({index:e,stepIndex:t,isLast:a=!1,lockedHint:r,title:l,choices:s=[],onDone:i,onChange:u}){const{t:c}=xe.useTranslation(),d=typeof e=="number"?e:-1,m=typeof t!="number"?"disabled":d<t?"done":d===t?"active":"disabled",[p,f]=o.useState(()=>s.map(()=>null)),b=JSON.stringify(s),x=s.length;o.useEffect(()=>{f(Array.from({length:x},()=>null))},[b]);const C=o.useRef(void 0);o.useEffect(()=>{const A=C.current;typeof A=="number"&&typeof t=="number"&&typeof e=="number"&&A>=e&&t<e&&f(Array.from({length:x},()=>null)),C.current=t},[t,e,x]);const h=o.useMemo(()=>p.filter(A=>A!==null).length+1,[p]),_=o.useCallback(A=>{if(!ta(m))return;const y=p;let w;if(y[A]!=null){const B=y[A];w=y.map(k=>k!==null&&k>=B?null:k)}else w=[...y],w[A]=h;f(w);const v={selectedOrder:w,words:s,__ts:Date.now()};try{typeof u=="function"&&u(v)}catch{}if(y[A]==null&&w.length>0&&w.every(B=>B!==null))try{typeof i=="function"&&i(v)}catch{}},[m,p,h,u,i,s]),g=l??c("training.selectInOrder","\uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return n.jsx(ea,{index:e,stepIndex:t,isLast:a,lockedHint:r,title:g,onDone:i,children:n.jsx("div",{className:"training-step__cards",children:s.map((A,y)=>n.jsx(Jo,{item:{word:A},disabled:m==="disabled",selectable:!0,selected:p[y]!==null,orderRank:p[y],onSelect:()=>_(y),flipDelay:y*120,hideLabel:!1,hideAudio:!0},`${A}-${y}`))})})}function Er(e){return null}Er.__isTrainingPage=!0;function xa(e,t){const a=m_();return{ctx:a,index:e,stepIndex:a.currentStepIndex,isLast:typeof e=="number"&&typeof t=="number"?e===t-1:!1,onDone:r=>a.handleStepDone(r,e),onChange:r=>a.handleStepChange(r,e)}}function Xc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i}=xa(e,t);return n.jsx(vs,{...a,index:r,stepIndex:l,isLast:s,onDone:i})}function Jc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(bs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function Qc({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(ys,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function ed({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(xs,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function td({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(Fc,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}function f_({_stepIndex:e,_totalSteps:t,...a}){const{index:r,stepIndex:l,isLast:s,onDone:i,onChange:u}=xa(e,t);return n.jsx(h_,{...a,index:r,stepIndex:l,isLast:s,onDone:i,onChange:u})}const nd=3e4,C_=/^(https?:|blob:|data:audio|\/|\.\/)/;function ad(e){return typeof e=="string"&&C_.test(e)?e:null}const g_=e=>typeof e=="string"&&e.trim()!==""?e:null,Bs=Symbol("timed-out");function b_(e,t){if(t<=0)return Promise.resolve(Bs);let a;return Promise.race([Promise.resolve(e),new Promise(r=>{a=setTimeout(()=>r(Bs),t)})]).finally(()=>clearTimeout(a))}function y_(e){return e?Na()||Xr()?!0:typeof window<"u"&&!!window.speechSynthesis:!1}function v_(e,t){const a=[],r=ad(t);r&&a.push({kind:"raw",resolve:async()=>r});const l=(e??"").trim();if(!l)return a;for(const[s,i]of[["urlResolver",Na()],["fallbackUrlResolver",Xr()]])i&&a.push({kind:s,resolve:async u=>{let c;try{c=await b_(i(l),u)}catch(m){return St(`question-sound-threw-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uB358\uC84C\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`,m),null}return c===Bs?(St(`question-sound-slow-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 ${nd}ms \uBC14\uD034 \uC548\uC5D0 \uC548 \uD480\uB838\uB2E4 \u2014 \uADF8 \uCC28\uB840\uB97C \uBC84\uB9AC\uACE0 \uB2E4\uC74C\uC73C\uB85C \uAC04\uB2E4. \uC11C\uBC84 \uD569\uC131\uC744 \uAE30\uB2E4\uB9AC\uB294 \uB9AC\uC878\uBC84\uB77C\uBA74 \uC774 \uC790\uB9AC\uAC00 \uAE38\uC5B4\uC9C4\uB2E4. \uC18C\uB9AC\uAC00 \uC544\uC608 \uC548 \uB098\uBA74 \uC5EC\uAE30\uBD80\uD130 \uBCF4\uB77C.`),null):g_(c)||(St(`question-sound-empty-${s}`,`[core] configureTTS \uC758 ${s} \uAC00 \uC8FC\uC18C\uB97C \uC548 \uC92C\uB2E4(\uBC1B\uC740 \uAC83: ${JSON.stringify(c)}) \u2014 \uADF8 \uCC28\uB840\uB294 \uAC74\uB108\uB6F4\uB2E4.`),null)}});return a}function x_(){return Date.now()+nd}const __=(e,t)=>Math.max(0,e-Date.now())/Math.max(1,t);function w_(e){St("question-sound-none",`[core] "${e}" \uC758 \uC18C\uB9AC \uC8FC\uC18C\uB97C \uD55C \uC790\uB9AC\uC5D0\uC11C\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uBE0C\uB77C\uC6B0\uC800 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4. configureTTS \uAC00 \uAC78\uB824 \uC788\uB294\uC9C0, \uB9AC\uC878\uBC84\uAC00 \uC8FC\uC18C\uB97C \uC8FC\uB294\uC9C0 \uC704 \uC904\uB4E4\uC744 \uBCF4\uB77C.`)}function Dr(...e){for(const t of e)if(typeof t=="string"){const a=t.trim();if(a.length)return a}else{if(typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t)&&t.length)return t.join(", ");if(t&&typeof t=="object"){const a=t,r=[a.text,a.label,a.value];for(const l of r){if(typeof l=="string"&&l.trim().length)return l.trim();if(typeof l=="number"||typeof l=="boolean")return String(l)}}}return null}function B_(e){return Dr(e?.question,e?.q,e?.sentence,e?.text,e?.prompt,e?.wording)}function k_(e){return ad(Dr(e?.questionSound,e?.soundSrc,e?.audioSrc,e?.sound,e?.audio,e?.src))}function rd(e){if(!e)return;if(typeof e.decision=="boolean")return e.decision;if(typeof e.correct=="boolean")return e.correct;if(typeof e.heard=="boolean")return e.heard;if(typeof e.judgement=="boolean")return e.judgement;const t=Dr(e?.status,e?.result,e?.judge,e?.note);if(t){const a=t.toLowerCase();if(["ok","true","\uB9DE\uC74C","\uC815\uB2F5"].some(r=>a.includes(r)))return!0;if(["ng","false","\uD2C0\uB9BC","\uC624\uB2F5"].some(r=>a.includes(r)))return!1}}function od(e){const{score:t,contextsLength:a,results:r=[],subtitle:l,onReplay:s,onClose:i,inline:u=!1,pending:c=!1}=e||{},{t:d}=xe.useTranslation(),m=o.useId(),p=o.useCallback(()=>!c,[c]);o.useEffect(()=>{const D=a??0;if(t!=null&&D>0&&t/D>.5){const N=window.setTimeout(()=>{window.dispatchEvent(new CustomEvent("party:trigger",{detail:{count:140,strength:1.6,duration:2200}}))},0);return()=>window.clearTimeout(N)}},[t,a]);const f=o.useCallback(D=>{const N=rd(D),I=Dr(D?.wording,D?.label);return N===!0?{variant:"main",label:I??d("training.result.heardWell","\uC798 \uB4E4\uC5C8\uC5B4\uC694")}:N===!1?{variant:"danger",label:I??d("training.result.notHeard","\uBABB \uB4E4\uC5C8\uC5B4\uC694")}:{variant:"disabled",label:I??d("training.result.notJudged","\uBBF8\uD310\uC815")}},[d]),b=a??0,x=t??0,C=o.useMemo(()=>Array.isArray(r)?r:[],[r]),h=o.useRef(null),[_,g]=o.useState(null),A=o.useCallback(()=>{h.current?.(),h.current=null,g(null)},[]);o.useEffect(()=>A,[A]);const y=o.useRef(0),w=(D,N)=>{if(!$n)return;const I=Math.round(performance.now()-y.current);console.debug(`[core][\uB2E4\uC2DC\uB4E3\uAE30] +${I}ms ${D}`,N??"")},v=o.useRef(0),B=o.useCallback((D,N,I)=>{A();const P=++v.current,K=()=>v.current===P;y.current=$n?performance.now():0,w(`\uB20C\uB800\uB2E4 \u2014 \uC904 ${D}`,{text:N,rawUrl:I}),g(D),h.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uC8FC\uC18C \uC5BB\uAE30 \uC804)"),v.current++,Yr()};const T=H=>{w("\uD2BC\uB2E4",H);const O=mr(H,U=>{w(`\uB05D\uB0AC\uB2E4 \u2014 ${U?"\uB05D\uAE4C\uC9C0 \uB4E4\uC5C8\uB2E4":"\uBABB \uD2C0\uC5C8\uAC70\uB098 \uBA48\uCDC4\uB2E4"}`,{mine:K()}),U&&K()&&(h.current=null,g(null))});return h.current=()=>{w("\uBA48\uCD94\uAC1C\uAC00 \uBD88\uB838\uB2E4(\uD2B8\uB294 \uC911)"),v.current++,O.stop(),Yr()},O.done},M=v_(N,I);w("\uCC28\uB840",M.map(H=>H.kind));const L=M[0]?.kind==="raw",Q=L?T(I):Promise.resolve(!1);(async()=>{if(await Q||!K())return;const H=x_(),O=L?M.slice(1):M;for(let U=0;U<O.length;U++){if(!K())return;w(`${O[U].kind} \uC5D0\uAC8C \uBB3B\uB294\uB2E4`);const $=await O[U].resolve(__(H,O.length-U));if(w(`${O[U].kind} \uAC00 \uB2F5\uD588\uB2E4`,$),!K()||$&&(await T($)||!K()))return}K()&&(w("\uC8FC\uC18C\uB97C \uD558\uB098\uB3C4 \uBABB \uC5BB\uC5C8\uB2E4 \u2014 \uB0AD\uB3C5\uC73C\uB85C \uAC04\uB2E4"),w_(N),h.current=()=>{v.current++,Yr()},w("\uB0AD\uB3C5\uD55C\uB2E4"),kf(N,{onEnd:()=>{K()&&(h.current=null,g(null))}}))})()},[A]),k=o.useMemo(()=>C.map(D=>{const N=D??{},I=B_(N)||d("training.result.noContent","(\uB0B4\uC6A9\uC5C6\uC74C)"),{variant:P,label:K}=f(N),T=Array.isArray(N.corrects)?N.corrects:[],M=T.length?T.join(", "):N.answer!=null&&N.answer!==""?String(N.answer):null,L=typeof N.selectedText=="string"?N.selectedText:null,Q=rd(N)===!0,H=k_(N),O=!!H||y_(I);return{problem:I,variant:P,label:K,answer:M,selectedText:L,isCorrect:Q,sound:H,canHear:O}}),[C,f,d]),E=o.useMemo(()=>k.some(D=>D.answer!==null||D.selectedText!==null),[k]);return n.jsx(On,{onClose:i,closeOnBackdrop:!1,inline:u,ariaLabel:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4."),className:"popup--training-result",beforeClose:p,footerClassName:"trp-result__foot",footer:({animateThen:D,closeWithAnimation:N})=>n.jsxs(n.Fragment,{children:[c&&n.jsx("p",{id:m,className:"trp-actions__reason caption-1",role:"status",children:d("training.result.pendingDone","\uACB0\uACFC\uB97C \uACC4\uC0B0\uD558\uB294 \uC911\uC774\uB77C \uC544\uC9C1 \uC644\uB8CC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}),n.jsxs("div",{className:"trp-actions",children:[n.jsx(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.replay","\uB2E4\uC2DC\uD558\uAE30"),onClick:()=>D(s)}),n.jsx(fe,{htmlType:"button",size:56,type:"bar",label:d("training.result.done","\uC644\uB8CC"),variant:"main",onClick:N,disabled:c,onDisabledClick:c?()=>{}:void 0,"aria-describedby":c?m:void 0})]})]}),children:()=>n.jsxs("div",{className:"trp-result is-on",children:[n.jsxs("header",{className:"trp-result__head",children:[n.jsx("p",{className:"trp-result__eyebrow caption-1",children:d("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")}),n.jsx("h1",{className:"trp-result__title h2",children:d("training.result.title","\uD6C8\uB828\uC744 \uBAA8\uB450 \uB9C8\uCCE4\uC2B5\uB2C8\uB2E4.")}),l&&n.jsx("p",{className:"trp-result__subtitle body-3",children:l}),n.jsx("div",{className:"trp-score",children:n.jsxs("div",{className:"trp-score__figure","aria-label":d("training.result.scoreAria",{correct:x,total:b}),children:[n.jsx("span",{className:"trp-score__big",children:x}),n.jsx("span",{className:"trp-score__sep",children:"/"}),n.jsx("span",{className:"trp-score__total",children:b})]})})]}),k.length>0&&n.jsx("section",{className:"trp-result__body",children:n.jsxs("div",{className:`result-table${E?" result-table--answer":""}`,role:"table","aria-label":d("training.result.tableAriaLabel","\uBB38\uD56D\uBCC4 \uD310\uC815"),children:[n.jsxs("div",{className:"result-table__head caption-1",role:"row",children:[n.jsx("span",{role:"columnheader",children:d("common.col.problem","\uBB38\uC81C")}),E&&n.jsx("span",{role:"columnheader",children:d("training.result.colAnswerSelected","\uC815\uB2F5 \xB7 \uC120\uD0DD")}),n.jsx("span",{className:"col-right",role:"columnheader",children:d("training.result.colJudge","\uD310\uC815")})]}),k.map((D,N)=>n.jsxs("div",{className:"result-table__row",role:"row",children:[n.jsxs("div",{className:"trp-row__problem",children:[n.jsx("span",{className:"trp-row__no caption-1",children:String(N+1).padStart(2,"0")}),n.jsx("div",{className:"trp-row__q body-2",children:D.problem}),D.canHear&&n.jsx(fe,{htmlType:"button",size:32,type:"dot",useBorder:!1,icon:_===N?"square":"volume-2",className:"trp-row__replay",ariaLabel:_===N?d("training.result.replaySoundStop",{no:N+1,defaultValue:"{{no}}\uBC88 \uB4E3\uAE30 \uBA48\uCDA4"}):d("training.result.replaySound",{no:N+1,defaultValue:"{{no}}\uBC88 \uB2E4\uC2DC \uB4E3\uAE30"}),onClick:()=>_===N?A():B(N,D.problem,D.sound)})]}),E&&n.jsxs("div",{className:"trp-row__answers",children:[D.answer!==null&&n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:"trp-row__answer-label answer-correct caption-1",children:d("training.result.colAnswer","\uC815\uB2F5")}),n.jsx("span",{className:"trp-row__answer-value body-2",children:D.answer})]}),n.jsxs("div",{className:"trp-row__answer-line",children:[n.jsx("span",{className:`trp-row__answer-label answer-selected caption-1 ${D.isCorrect?"is-correct":"is-wrong"}`,children:d("training.result.colSelected","\uC120\uD0DD")}),n.jsx("span",{className:`trp-row__answer-value body-2 ${D.isCorrect?"is-correct":"is-wrong"}`,children:D.selectedText??"\u2014"})]})]}),n.jsx("div",{className:"trp-row__judge",children:n.jsx(Et,{variant:D.variant,label:D.label,fill:"soft",minWidth:80})})]},N))]})})]})})}const ks=new Set;function A_(e){o.useEffect(()=>{if(!e||ks.has(e))return;ks.add(e);const t=()=>typeof document>"u"||document.visibilityState!=="hidden";let a=null,r=null,l=0,s=0;const i=()=>{const m=Date.now();a==null&&(a=m),r==null&&(r=m)},u=()=>{r!=null&&(l+=Date.now()-r,r=null)};t()&&i();const c=()=>{if(u(),a==null)return;const m=l-s;if(m<1e3||s===0&&l<5e3)return;const p=Date.now(),f=p-m;s=l,yC({trainingType:e,startedAt:new Date(f).toISOString(),endedAt:new Date(p).toISOString()})},d=()=>{t()?i():c()};return typeof document<"u"&&document.addEventListener("visibilitychange",d),typeof window<"u"&&window.addEventListener("pagehide",c),()=>{typeof document<"u"&&document.removeEventListener("visibilitychange",d),typeof window<"u"&&window.removeEventListener("pagehide",c),c(),ks.delete(e)}},[e])}function Sr(e,t){return e&&e.id||`page-${t??0}`}function jr(e,t){return e&&e.key||`step-${t??0}`}function Tr(){return{pageIndex:0,stepIndex:0,answersByPage:{}}}function N_(e,t){return typeof e?.props=="function"?e.props(t)||{}:e?.props||{}}const E_=300,D_=()=>{try{return typeof window<"u"&&!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}},Sn=Object.freeze({}),sd=new Set(["LISTEN_IN_NOISE","SHORT_STORY","LONG_STORY","ORDERING_SENTENCE"]);function As(e){const t=e,a=t?.results||t?.answers||[],r=Array.isArray(a)&&a.length>0?a.length:null,l=Array.isArray(a)?a.filter(s=>s?.correct===!0||s?.isCorrect===!0||s?.score===1||s?.heard===!0||s?.judgement===!0).length:null;return{results:a,correct:r!=null?l:null,total:r}}const S_=e=>n.jsx(od,{score:e.score,contextsLength:e.contextsLength,results:e.results,onReplay:e.onReplay,onClose:e.onClose,pending:e.pending});function j_(e){const{scenario:t,title:a,subTitle:r,depth:l,icon:s,wrapperStyle:i,iconTooltip:u,pageIndex:c,pageCount:d,stepIndex:m,stepCount:p,onBack:f,onComplete:b,onRoundFinished:x,onNext:C,onSettings:h,useNoiseSetting:_=!0,children:g,ariaLabel:A,label:y,buildResults:w,onResult:v,typeKey:B,entryPoint:k,dailyTotal:E,itemRef:D,renderResultPopup:N,noiseOverride:I,hideNoiseRows:P=!1}=e;A_(B&&!sd.has(B)?B:"");const K=o.useRef(0);o.useEffect(()=>{K.current=Date.now()},[]);const{t:T}=xe.useTranslation(),M=v,L=!!t,Q=t?.id||null,H=t?.meta||{},O=Array.isArray(t?.pages)?t.pages:[],U=Array.isArray(g)||o.isValidElement(g)&&typeof g!="function"?o.Children.toArray(g).filter(o.isValidElement):[],$=U.length>0,V=le=>le===Er||le?.__isTrainingPage===!0,z=$&&U.some(le=>V(le.type)),Y=z?U.filter(le=>V(le.type)).map((le,Be)=>{const Te=le.props||{};return{id:`children-page-${Be}`,steps:o.Children.toArray(Te.children).filter(o.isValidElement),pageTop:Te.pageTop||Te.top||null,pageBottom:Te.pageBottom||Te.bottom||null}}):[{id:"children-page-0",steps:U}],S=$&&!L&&typeof g!="function",R=S?Math.max(1,Y.length):0;o.useEffect(()=>{if(!(typeof document>"u"||!document.body)&&!document.body.classList.contains("ihabdevteam-core-scope"))return document.body.classList.add("ihabdevteam-core-scope"),()=>{document.body.classList.remove("ihabdevteam-core-scope")}},[]),o.useEffect(()=>{if(typeof document>"u"||!document.body)return;const le=document.body;return le.dataset.ihabTrainingPopupCount=String(Number(le.dataset.ihabTrainingPopupCount||"0")+1),le.classList.add("ihab-training-popup-open"),()=>{const Be=Number(le.dataset.ihabTrainingPopupCount||"1")-1;Be>0?le.dataset.ihabTrainingPopupCount=String(Be):(delete le.dataset.ihabTrainingPopupCount,le.classList.remove("ihab-training-popup-open"))}},[]),o.useEffect(()=>{if(!(typeof document>"u"||!document.body))return Q2()},[]);const[F,Z]=o.useState({...Qn,enabled:!1}),pe=o.useRef(F);o.useEffect(()=>{pe.current=F},[F]);const re=o.useRef(I),oe=o.useRef(!1),ne=o.useRef(null);o.useEffect(()=>{let le=!1;const Be=Te=>{if(le)return;oe.current=!0;const Ke=Te?Jn({...Qn,enabled:!1},Te):{...Qn},Fe=ne.current;ne.current=null;const X=Fe?Jn(Ke,Fe):Ke;pe.current=X,Z(X),Fe&&!re.current&&uo(X),rr(X);const ue=re.current;if(ue){const ee=typeof ue=="function"?ue(X):ue,ve=Jn(X,ee);pe.current=ve,Z(ve),rr(ve)}};return SC().then(Te=>{if(le){const Ke=ne.current;if(ne.current=null,Ke&&!re.current){const Fe=Te?Jn({...Qn,enabled:!1},Te):{...Qn};uo(Jn(Fe,Ke))}return}Be(Te)}),()=>{le=!0}},[]);const[W,ie]=o.useState(null),[q,G]=o.useState(null),de=o.useCallback((le,Be)=>{le==="main"?ie(Be):G(Be)},[]),Ee=o.useRef(null),ye=o.useRef(null),me=o.useCallback(()=>{ye.current!==null&&(clearTimeout(ye.current),ye.current=null);const le=Ee.current;Ee.current=null,le&&uo(le)},[]);o.useEffect(()=>{if(typeof window>"u")return;const le=()=>{document.visibilityState==="hidden"&&me()};return window.addEventListener("pagehide",me),document.addEventListener("visibilitychange",le),()=>{window.removeEventListener("pagehide",me),document.removeEventListener("visibilitychange",le),me()}},[me]);const se=o.useCallback(le=>{const Be=Jn(pe.current,le);if(pe.current=Be,Z(Be),!oe.current){ne.current={...ne.current??{},...le},rr(Be);return}re.current||(Ee.current=Be,ye.current!==null&&clearTimeout(ye.current),ye.current=setTimeout(me,E_)),rr(Be)},[me]),Ce=F.mainSpeed,ge=F.mainVolume,ce=o.useCallback(le=>se({mainSpeed:le}),[se]),Me=o.useCallback(le=>se({mainVolume:le}),[se]),Oe=o.useMemo(()=>({settings:F,setSettings:se,registerAnalyser:de,mainAnalyser:W,noiseAnalyser:q,playbackRate:Ce,setPlaybackRate:ce,mainVolume:ge,setMainVolume:Me}),[F,se,de,W,q,Ce,ce,ge,Me]),Le=o.useRef(null),[ze,We]=o.useState(0),dt=o.useRef([]),[lt,at]=o.useState("center"),[mt,Ae]=o.useState(!1),qe=o.useRef(!1),we=o.useRef(null),Ue=o.useCallback(le=>{qe.current||(qe.current=!0,Ae(!0),we.current=setTimeout(()=>{try{le()}catch{qe.current=!1,Ae(!1)}},D_()?0:Zx))},[]);o.useEffect(()=>()=>{we.current&&clearTimeout(we.current)},[]);const ke=o.useRef(f);o.useEffect(()=>{ke.current=f});const $e=o.useRef(typeof document>"u"?null:document.activeElement);o.useEffect(()=>{const le=Le.current,Be=$e.current;if(fo(le,Be),le){const Te=Array.from(le.querySelectorAll(gn)).filter(Ke=>!Ke.closest('[aria-hidden="true"]'))[0];if(Te)try{Te.focus()}catch{}}return()=>{const Te=document.activeElement;if(!Te||Te===document.body||le&&le.contains(Te))try{Co(Be)?.focus?.()}catch{}}},[]),o.useEffect(()=>Gn(()=>Ue(()=>{const le=ke.current;typeof le=="function"&&le()})),[Ue]),mo(Le,!0);const[je,Ze]=o.useState(!1),yt=o.useRef(!1),[et,Xe]=o.useState(null),_t=o.useRef(0),Ct=o.useRef(0),wt=()=>{_t.current+=1,Ct.current+=1,Xe(null)},[Bt,ht]=o.useState(""),[rt,te]=o.useState(()=>Tr()),Ne=o.useRef(typeof c=="number"?c:null);o.useEffect(()=>{!L&&!S||(te(Tr()),wt())},[L,Q,S]),o.useEffect(()=>{S&&te(le=>{const Be=Math.max(0,Math.min(le.pageIndex,Math.max(0,R-1)));return Be!==le.pageIndex?{...le,pageIndex:Be,stepIndex:0}:le})},[S,R]);const Je=S?Math.max(0,Math.min(rt.pageIndex,R-1)):0,Ve=S?Y[Je]:null,it=S&&Ve&&Array.isArray(Ve.steps)?Ve.steps:[],Se=L?rt.pageIndex:S?Je:typeof c=="number"?c:0,pt=L?O[Math.max(0,Math.min(rt.pageIndex,Math.max(0,O.length-1)))]:null,gt=L&&pt&&Array.isArray(pt.steps)?pt.steps:[],Pe=L?gt.length:S?it.length:typeof p=="number"?p:0,nt=L||S?Math.max(0,Math.min(rt.stepIndex,Math.max(0,Pe))):typeof m=="number"?m:0,vt=L?O.length:S?R:typeof d=="number"?d:0;o.useEffect(()=>{if(!L&&!S)return;const le=L?Sr(pt,Se):Ve?.id||`children-page-${Se??0}`,Be=new Date().toISOString();for(let Te=0;Te<=nt;Te+=1){const Ke=L?jr(gt[Te],Te):`step-${Te}`,Fe=ct(le,Ke);st.current.has(Fe)||st.current.set(Fe,Be)}},[L,S,Se,nt,Ve?.id]),o.useLayoutEffect(()=>{const le=Ne.current;if(typeof Se=="number"&&le!==null&&Se!==le&&Se>le)try{ht(T("training.problemNotice",{n:Se+1}))}catch{}Ne.current=typeof Se=="number"?Se:Ne.current},[Se,c,T]),o.useLayoutEffect(()=>{const le=Le.current;if(!le)return;const Be=()=>le.querySelector(".page-popup__scroll");let Te=null,Ke=null,Fe=null;const X=He=>{const tt=Be();if(!tt)return;const ft=tt.scrollHeight<=tt.clientHeight;if(at(ft?"center":"top"),He&&!yt.current){yt.current=!0;try{Ze(!0)}catch{}try{ve.disconnect()}catch{}}},ue=()=>{Te!==null&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Ke!==null&&clearTimeout(Ke),Ke=setTimeout(()=>X(!0),60)})},ee=()=>{Fe!==null&&cancelAnimationFrame(Fe),Fe=requestAnimationFrame(()=>X(!1))};ue(),window.addEventListener("resize",ee);const ve=new MutationObserver(ue);ve.observe(le,{childList:!0,subtree:!0,attributes:!0});const Re=setTimeout(()=>{yt.current||X(!0)},400);return()=>{window.removeEventListener("resize",ee),Te!==null&&cancelAnimationFrame(Te),Ke!==null&&clearTimeout(Ke),Fe!==null&&cancelAnimationFrame(Fe),clearTimeout(Re);try{ve.disconnect()}catch{}}},[Le]);const Ge=o.useCallback(le=>{Le.current&&(Le.current._childOnNext=le)},[]),ot=o.useCallback(le=>{Le.current&&(Le.current._childOnResult=le)},[]),st=o.useRef(new Map),ct=(le,Be)=>`${le}\0${Be}`,kt=o.useCallback((le,Be,Te)=>{te(Ke=>{const Fe=Ke.answersByPage[le]||{},X=Fe[Be],ue=ws(Te),ee=ws(X);if(X&&ee>ue)return Ke;const ve=Kc(Te,st.current.get(ct(le,Be)),ue);return{...Ke,answersByPage:{...Ke.answersByPage,[le]:{...Fe,[Be]:ve}}}})},[te]),Vt=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te)},[pt,Se,kt]),en=o.useCallback((le,Be,Te)=>{const Ke=Sr(pt,Se),Fe=jr(le,Be);kt(Ke,Fe,Te),!Te?.allowChange&&le?.autoAdvance!==!1&&te(X=>({...X,stepIndex:Math.max(X.stepIndex,Be+1)}))},[pt,Se,kt,te]),Cn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=typeof Be=="number"?Be:nt??0,Fe=`step-${Ke}`;kt(Te,Fe,le),le?.allowChange||te(X=>({...X,stepIndex:Math.max(X.stepIndex,Ke+1)}))},[Ve,Se,nt,kt,te]),jn=o.useCallback((le,Be)=>{const Te=Ve?.id||`children-page-${Se??0}`,Ke=`step-${typeof Be=="number"?Be:nt??0}`;kt(Te,Ke,le)},[Ve,Se,nt,kt]),Wn=S?{currentPageIndex:Se??0,currentStepIndex:nt??0,totalStepsInPage:it.length,handleStepDone:Cn,handleStepChange:jn}:null,Hn=async()=>{const le=typeof t?.buildResults=="function"?await Promise.resolve(t.buildResults({scenario:t,pages:O,flowState:rt,answersByPage:rt.answersByPage})):null;return typeof M=="function"&&await Promise.resolve(M(le))||le},qt=async()=>{const le=Ve?.id||`children-page-${rt.pageIndex}`,Be=rt.answersByPage[le]||{},Te=z?(()=>{const X={};let ue=0;return Y.forEach(ee=>{const ve=rt.answersByPage[ee.id]||{},Re=Array.isArray(ee.steps)?ee.steps.length:0;for(let He=0;He<Re;He+=1){const tt=ve[`step-${He}`];typeof tt<"u"&&(X[`step-${ue+He}`]=tt)}ue+=Re}),X})():Be;if(typeof w=="function"){const X=await Promise.resolve(w(Te,{pageAnswers:Be,answersByPage:rt.answersByPage,pages:Y,currentPageId:le}));return typeof M=="function"&&await Promise.resolve(M(X))||X}const Ke=Object.entries(Be).map(([X,ue],ee)=>({index:ee,key:X,payload:ue})),Fe={results:Ke,answers:Ke,score:0};return typeof M=="function"&&await Promise.resolve(M(Fe))||Fe},dn=()=>{const le=++_t.current,Be=()=>le!==_t.current;try{if(typeof document<"u"&&document.body){try{document.dispatchEvent(new CustomEvent("speechear-close-tooltips"))}catch{}document.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0})),document.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}}catch{}if(L){const Fe=Hn();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}if(S){const Fe=qt();Xe(Sn);const X=Fe;Promise.resolve(X).then(ue=>{Be()||Xe(ue||{isEmpty:!0})}).catch(ue=>{!Be()&&Xe({isEmpty:!0})});return}const Te=Le.current&&Le.current._childOnResult,Ke=Fe=>{try{return Fe?Fe():void 0}catch{return}};if(typeof Te=="function"){const Fe=Ke(Te);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{ue&&!Be()?Xe(ue):X()}).catch(ue=>{X()});return}if(typeof M=="function"){const Fe=Ke(M);try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}Fe&&typeof Fe.then!="function"?Xe(Fe):Xe(Fe&&typeof Fe.then=="function"?Sn:{});const X=()=>{Be()||Xe(ue=>ue===Sn?{}:ue)};Promise.resolve(Fe).then(ue=>{try{typeof document>"u"?require("url").pathToFileURL(__filename).href:_n&&_n.tagName.toUpperCase()==="SCRIPT"&&_n.src||new URL("components.cjs.js",document.baseURI).href}catch{}ue&&!Be()?Xe(ue):X()}).catch(ue=>{console.error("viewResults external handler failed",ue),X()});return}},Ut=()=>{if(L){if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){te(Be=>({...Be,pageIndex:Be.pageIndex+1,stepIndex:0}));return}return dn()}if(S){const Be=it.length;if(typeof nt=="number"&&nt<Be-1){te(Te=>({...Te,stepIndex:Te.stepIndex+1}));return}if(typeof Se=="number"&&typeof vt=="number"&&Se<vt-1){te(Te=>({...Te,pageIndex:Te.pageIndex+1,stepIndex:0}));return}return dn()}if(typeof C=="function"){try{C()}catch{}return}const le=Le.current&&Le.current._childOnNext;if(typeof le=="function"){try{le()}catch{}return}},Lt=L?H.title||H.label||A||T("common.popup","\uD31D\uC5C5"):a||y||(Array.isArray(l)?l[l.length-1]:void 0)||A||T("common.popup","\uD31D\uC5C5"),Tn=A||Lt,ln=L?H.title??H.label??Lt:a??y??Lt,Mn=(le,Be)=>{const Te=Sr(pt,Se),Ke=jr(le,Be),Fe=rt.answersByPage[Te]?.[Ke],X=N_(le,{page:pt,pageIndex:Se,step:le,stepIndex:Be,storedPayload:Fe,answersByPage:rt.answersByPage,flowState:rt}),ue={key:Ke,index:Be,stepIndex:nt,isLast:Be===gt.length-1};switch(le?.type){case"listen":return n.jsx(vs,{...ue,...X,onDone:ee=>en(le,Be,ee)});case"confirm":return n.jsx(bs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"confirmWithText":return n.jsx(ys,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});case"orderList":return n.jsx(xs,{...ue,...X,onDone:ee=>en(le,Be,ee),onChange:ee=>Vt(le,Be,ee)});default:return null}},Ln=o.useRef(void 0);o.useEffect(()=>{const le=Ln.current;if(Ln.current=Se,le===void 0||le===Se||!Cr())return;const Be=Le.current;if(!Be)return;const Te=document.activeElement;if(!(!Te||Te===document.body||!Be.contains(Te)||Te.disabled===!0))return;const Ke=Be.querySelector(`.training-steps ${gn.split(", ").join(", .training-steps ")}`)??Array.from(Be.querySelectorAll(gn)).find(Fe=>!Fe.closest('[aria-hidden="true"]'));try{Ke?.focus()}catch{}},[Se]);const xn=L?O.length>0?n.jsx("div",{className:"training-steps",children:gt.map((le,Be)=>Mn(le,Be))},`replay-${ze}`):n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"pp-empty",children:t?.emptyMessage||T("training.noQuestions","\uBB38\uC81C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")})}):null,Gt=S?n.jsxs(Zc.Provider,{value:Wn,children:[Ve?.pageTop?n.jsx("div",{className:"training-page-top",children:Ve.pageTop}):null,n.jsx("div",{className:"training-steps",children:it.map((le,Be)=>{const Te=le;return o.cloneElement(Te,{...Te.props,_stepIndex:Be,_totalSteps:it.length,_stepKey:`step-${Be}`,_pageIndex:Se})})},`replay-${ze}`),Ve?.pageBottom?n.jsx("div",{className:"training-page-bottom",children:Ve.pageBottom}):null]}):null,Ft=o.useRef(-1),$t=o.useCallback(()=>{if(!B)return;const le=et,{results:Be,correct:Te,total:Ke}=As(et),Fe={correct:Te,total:Ke,attempt:dt.current.length+1,previousAttempts:[...dt.current]};if(Ft.current===Ct.current)return Fe;Ft.current=Ct.current,vC({items:DC(Be),category:sd.has(B)?"sentence":"word",trainingType:B,entryPoint:k??"sentence",itemRef:D??null,correct:Te,total:Ke,score:typeof le?.score=="number"?le.score:null,durationSeconds:Math.max(0,Math.round((Date.now()-K.current)/1e3)),dailyTotal:E??null});try{x?.(Fe)}catch{}return Fe},[B,k,E,D,et,x]);o.useEffect(()=>{!et||et===Sn||et?.isEmpty||(As(et).total??0)>0&&$t()},[et,$t]);const pn=o.useCallback(()=>{const le=$t();wt(),Ue(()=>{typeof b=="function"&&b(le),typeof f=="function"&&f()})},[b,f,$t,Xe,Ue]),Ot=o.useCallback(()=>ht(""),[ht]),tn=o.useCallback(()=>{Ue(()=>{typeof f=="function"&&f()})},[f,Ue]),Tt=n.jsxs("div",{className:`page-popup${mt?" page-popup--closing":""}`,role:"dialog","aria-modal":"true","aria-label":Tn,children:[n.jsxs("div",{ref:Le,className:`page-popup__panel ${je?"":"page-popup__panel--measuring"} ${lt==="center"?"page-popup__panel--center":lt==="top"?"page-popup__panel--top":""}`,children:[n.jsx(qc,{title:ln,subtitle:L?H.subtitle||H.label:Array.isArray(l)?l.join(" / "):void 0,desc:L?void 0:r,depth:L?H.depth:l,icon:L?H.icon:s,wrapperStyle:L?H.wrapperStyle:i,iconTooltip:L?H.iconTooltip:u,progressMax:vt,progressIndex:Se,pageIndex:Se,pageCount:vt,onBack:tn,onClose:tn}),n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content ${lt==="center"?"page-popup__content--center":"page-popup__content--top"}${e.contentFull?" page-popup__content--full":""}`,children:S?Gt:L?xn:typeof g=="function"?g({registerOnNext:Ge,registerOnResult:ot,panelRef:Le,setResultOverlay:Xe}):g})}),n.jsx(Vc,{onSettings:h,onNext:Ut,onResult:dn,useNoiseSettingBtn:!!(L?H.useNoiseSetting??!0:_),stepIndex:nt,stepCount:Pe,pageIndex:Se,pageCount:vt,resultOpen:!!(et&&!et.isEmpty),hideNoiseRows:P})]}),et&&!et.isEmpty&&(N??S_)({score:et.score,results:et.results||et.answers||[],contextsLength:et.results?et.results.length:et.answers?et.answers.length:0,onReplay:()=>{if(K.current=Date.now(),et!==Sn){const{correct:le,total:Be}=As(et);dt.current.push({correct:le,total:Be})}if(wt(),We(le=>le+1),L){if(te(Tr()),typeof t?.onReplay=="function")try{t.onReplay()}catch{}return}if(S){te(Tr());return}try{const le=Le.current&&Le.current._childOnResult;typeof le=="function"&&le({replay:!0})}catch{}},onClose:pn,pending:et===Sn}),et?.isEmpty&&n.jsx("div",{className:"page-popup page-popup--result-empty",role:"dialog","aria-modal":"true","aria-label":T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC"),children:n.jsxs("div",{className:"page-popup__panel page-popup__panel--center",children:[n.jsx("div",{className:"page-popup__scroll",children:n.jsx("div",{className:`page-popup__content page-popup__content--center${e.contentFull?" page-popup__content--full":""}`,children:n.jsx("div",{className:"page-popup__empty",children:T("training.result.eyebrow","\uD6C8\uB828 \uC644\uB8CC")})})}),n.jsx("div",{className:"page-popup__bottom",children:n.jsx(fe,{htmlType:"button",variant:"main",size:48,onClick:pn,label:T("training.result.done","\uC644\uB8CC")})})]})}),n.jsx(ha,{message:Bt,position:"top",onClose:Ot})]}),Kt=n.jsx(ps.Provider,{value:Oe,children:Tt});return typeof document<"u"&&document.body?nn.createPortal(Kt,document.body):Kt}const zn=j_;zn.Page=Er,zn.ListenStep=Xc,zn.ConfirmStep=Jc,zn.ConfirmWithTextStep=Qc,zn.OrderListStep=ed,zn.CardStep=td,zn.CardOrderStep=f_;function T_({label:e,homonum:t}){const a=sa()?.(e,t)??"",{imgRef:r,loading:l,hasImage:s,onLoad:i,onError:u}=Xo(a);return s?n.jsxs("div",{className:"tooltip-word-image__cell",children:[l&&n.jsx("div",{className:"tooltip-word-image__spinner"}),n.jsx("img",{ref:r,src:a,alt:e,draggable:!1,style:{opacity:l?0:1},onLoad:i,onError:u})]}):n.jsx("div",{className:"tooltip-word-image__cell tooltip-word-image__cell--text h3",children:n.jsx("span",{children:e})})}function ld({words:e,anchorRect:t}){const a=o.useRef(null),[r,l]=o.useState(null);return o.useLayoutEffect(()=>{if(!t||!a.current)return;const{offsetWidth:s,offsetHeight:i}=a.current,u=window.innerWidth;let c=t.left+t.width/2-s/2,d=t.top-i-8;d<8&&(d=t.bottom+8),c=Math.max(8,Math.min(c,u-s-8)),l({left:c,top:d})},[t]),!t||e.length===0?null:nn.createPortal(n.jsx("div",{ref:a,className:"tooltip-word-image",style:{visibility:r?"visible":"hidden",left:r?.left??0,top:r?.top??-9999},children:n.jsx("div",{className:"tooltip-word-image__cells",children:e.map(s=>n.jsx(T_,{label:s.label,homonum:s.homonum},`${s.label}_${s.homonum??1}`))})}),document.body)}function M_({titleIcon:e,resultCount:t,resultUnit:a,searchQuery:r,items:l,groups:s,selected:i=[],onSelect:u,maxSelect:c,onClearSelection:d,onPrint:m,onPrintEmpty:p,className:f,emptyHint:b,sectionType:x="page",disc:C}){const{t:h,i18n:_}=xe.useTranslation(),g=_.language?.startsWith("ko")??!1,{anchorRect:A,openAt:y,close:w}=Pa(),[v,B]=o.useState(null),k=o.useCallback(()=>{w(),B(null)},[w]);Ey(k,!!v);const E=(r??"").trim(),D=/^[^,[\]\s]+$/.test(E)?E:"",N=D.length>0,I=r===void 0&&t===void 0,P=N?"match":I?"original":"ganada",[K,T]=o.useState(()=>P),[M,L]=o.useState("50"),[Q,H]=o.useState(1),[O,U]=o.useState(N);O!==N&&(U(N),T(P));const $=K==="match"&&!N||K==="original"&&!I?P:K,V=o.useMemo(()=>[...N?[{value:"match",label:h("wordSearch.sort.match",{defaultValue:"\uC2DC\uC791 \uC6B0\uC120"})}]:[],...I?[{value:"original",label:h("wordSearch.sort.original",{defaultValue:"\uBC1B\uC740 \uC21C\uC11C"})}]:[],{value:"ganada",label:h("wordSearch.sort.ganada",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2191"})},{value:"ganada_desc",label:h("wordSearch.sort.ganadaDesc",{defaultValue:"\uAC00\uB098\uB2E4\uC21C \u2193"})},{value:"syllable",label:h("wordSearch.sort.syllable",{defaultValue:"\uC74C\uC808 \uC218 \u2191"})},{value:"syllable_desc",label:h("wordSearch.sort.syllableDesc",{defaultValue:"\uC74C\uC808 \uC218 \u2193"})},{value:"grade",label:h("wordSearch.sort.grade",{defaultValue:"\uB4F1\uAE09\uC21C \u2191"})},{value:"grade_desc",label:h("wordSearch.sort.gradeDesc",{defaultValue:"\uB4F1\uAE09\uC21C \u2193"})}],[h,N,I]),z=o.useMemo(()=>["10","25","50","100"].map(se=>({value:se,label:h("wordSearch.pageSize",{count:Number(se),defaultValue:`${se}\uAC1C\uC529 \uBCF4\uAE30`})})),[h]),Y=se=>se.words?.[0],S=o.useMemo(()=>{const se=[...D].length,Ce=nC(D),ge=new Map;return ce=>{let Me=ge.get(ce);return Me===void 0&&(Me=Ce((ce.words?.[0]?.label??"").slice(0,se))?0:1,ge.set(ce,Me)),Me}},[D]),R=o.useCallback((se,Ce)=>{const ge=Oe=>Y(Oe)?.label??"",ce=Oe=>Y(Oe)?.syllables??[...ge(Oe)].length,Me=Oe=>(Oe.words??[]).reduce((Le,ze)=>{const We=parseInt(ze.grade??"",10);return Number.isFinite(We)&&We<Le?We:Le},999);switch($){case"match":return S(se)-S(Ce)||on(ge(se),ge(Ce));case"ganada":return on(ge(se),ge(Ce));case"ganada_desc":return on(ge(Ce),ge(se));case"syllable":return ce(se)-ce(Ce)||on(ge(se),ge(Ce));case"syllable_desc":return ce(Ce)-ce(se)||on(ge(se),ge(Ce));case"grade":return Me(se)-Me(Ce)||on(ge(se),ge(Ce));case"grade_desc":return Me(Ce)-Me(se)||on(ge(se),ge(Ce));default:return 0}},[$,S]),F=o.useMemo(()=>l.slice().sort(R),[l,R]),Z=Number(M)||10,pe=o.useMemo(()=>(s??[]).flatMap(se=>se.items.slice().sort(R).map(Ce=>({item:Ce,label:se.label}))),[s,R]),re=s?pe.length:F.length,oe=Math.max(1,Math.ceil(re/Z)),ne=Math.min(Q,oe),W=o.useMemo(()=>F.slice((ne-1)*Z,ne*Z),[F,ne,Z]),ie=o.useId(),q=o.useMemo(()=>{if(!s)return null;const se=pe.slice((ne-1)*Z,ne*Z),Ce=new Map;for(const{item:ge,label:ce}of se)Ce.has(ce)||Ce.set(ce,[]),Ce.get(ce).push(ge);return[...Ce.entries()].map(([ge,ce])=>({label:ge,items:ce}))},[s,pe,ne,Z]);o.useEffect(()=>{H(1)},[K,M,re,r]);const G=re>0?n.jsxs("div",{className:"word-search-result-block__toolbar",children:[n.jsx(cn,{size:40,options:V,value:$,onChange:T,ariaLabel:h("wordSearch.sort.aria",{defaultValue:"\uC815\uB82C"})}),n.jsx(cn,{size:40,options:z,value:M,onChange:L,ariaLabel:h("wordSearch.pageSizeAria",{defaultValue:"\uD398\uC774\uC9C0 \uD06C\uAE30"})}),n.jsx(hr,{page:ne,totalPages:oe,onChange:H})]}):void 0,de=se=>{u&&u(se)},Ee=t!==void 0&&a?n.jsxs(n.Fragment,{children:[h("wordSearch.resultTitlePrefix","\uCD1D "),n.jsx("span",{style:{color:"var(--color-main)"},children:t}),h("wordSearch.resultTitleSuffix",{unit:g?mC(a):a})]}):void 0,ye=t!==void 0&&t>0&&c!==void 0&&a?h("wordSearch.resultDisc",{unit:g?fC(a):a,max:c,selected:i.length}):void 0,me=C??ye;return n.jsxs(Ca,{type:x,className:_e("word-search-result-block",f),children:[n.jsxs("div",{className:"word-search-result-block__inner",children:[(Ee||G||me)&&n.jsxs("div",{className:"word-search-result-block__head",children:[n.jsxs("div",{className:"word-search-result-block__head-main",children:[e&&n.jsx(Qe,{icon:e,className:"word-search-result-block__head-icon"}),Ee&&n.jsx("span",{className:"word-search-result-block__title h3",children:Ee})]}),G&&n.jsx("div",{className:"word-search-result-block__head-actions",children:G}),me&&n.jsx("div",{className:"word-search-result-block__head-disc body-3",children:me})]}),(s?s.length===0:l.length===0)&&n.jsxs("div",{className:"word-search-result-block__empty-wrap",children:[n.jsx("p",{className:"word-search-result-block__empty body-3",children:h("wordSearch.emptyResult","\uAC80\uC0C9 \uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")}),b&&n.jsx("p",{className:"word-search-result-block__empty-hint body-3",children:b})]}),s?(q??[]).map(se=>n.jsxs("div",{className:"word-search-result-block__group",role:"group","aria-labelledby":`${ie}-${se.label}`,children:[n.jsx("div",{className:"word-search-result-block__group-label caption-1b",id:`${ie}-${se.label}`,children:se.label}),n.jsx("div",{className:"word-search-result-block__items",children:se.items.map(Ce=>{const ge=i.includes(Ce.id);return n.jsx("div",{onMouseEnter:ce=>{y(ce.currentTarget),B(Ce.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(Ce.words??[]).map(ce=>ce.label),subLabel:(Ce.words??[]).some(ce=>ce.subLabel)?(Ce.words??[]).map(ce=>ce.subLabel):void 0,selected:ge,onClick:()=>de(Ce.id),minWidth:200})},Ce.id)})})]},se.label)):n.jsx("div",{className:"word-search-result-block__items",children:W.map(se=>{const Ce=i.includes(se.id);return n.jsx("div",{onMouseEnter:ge=>{y(ge.currentTarget),B(se.words??[])},onMouseLeave:k,children:n.jsx(fe,{htmlType:"button",size:"word",align:"grid",label:(se.words??[]).map(ge=>ge.label),subLabel:(se.words??[]).some(ge=>ge.subLabel)?(se.words??[]).map(ge=>ge.subLabel):void 0,selected:Ce,onClick:()=>de(se.id),minWidth:200})},se.id)})}),v&&A&&n.jsx(ld,{words:v,anchorRect:A})]}),oe>1&&n.jsx("div",{className:"word-search-result-block__pagination-bottom",children:n.jsx(hr,{page:ne,totalPages:oe,onChange:H})}),(d||m)&&n.jsxs("div",{className:"word-search-result-block__actions",children:[d&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:h("common.resetSelection","\uC120\uD0DD \uCD08\uAE30\uD654"),selected:!1,disabled:i.length===0,onClick:i.length===0?void 0:d}),m&&n.jsx("div",{onClick:i.length===0?p:void 0,children:n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:h("wordTable.title","\uB2E8\uC5B4 \uD45C \uB9CC\uB4E4\uAE30"),disabled:i.length===0,onClick:i.length===0?void 0:m})})]})]})}function L_(e,t){return t.map(a=>{const r=typeof a=="string"?a:a.label,l=typeof a=="string"?void 0:a.displayLabel;return{label:r,value:e[r]??"",displayLabel:l}})}function $_({sections:e,selectedList:t,count:a,onCountChange:r,maxCount:l=4,minCount:s=1,combinationSections:i,combinationSectionsForSlot:u,onSelect:c,placeholder:d="-",className:m,title:p,titleIcon:f,disc:b,showInfoButton:x=!0,onClearPhoneme:C,onSearch:h,onSearchEmpty:_,searchDisabled:g=!1,searchLabel:A,searchChecking:y=!1,pairMode:w=!1,sectionType:v="page",beforeSearchContent:B,beforeContent:k,afterContent:E,hideCountControl:D=!1,ordinal:N=!1}){const{t:I}=xe.useTranslation(),P=o.useMemo(()=>I("wordPairs.infoNotes",{returnObjects:!0}),[I]),K=o.useMemo(()=>Array.from({length:l-s+1},(S,R)=>{const F=s+R;return{key:String(F),label:I("wordPairs.count",{n:F})}}),[I,l,s]),T=o.useMemo(()=>I("wordPairs.ordinals",{returnObjects:!0}),[I]),M=o.useCallback(S=>N?I("wordPairs.phonemeOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeSingleLabel","\uC74C\uC808"):I("wordPairs.phonemeN",{n:S}),[N,T,a,I]),L=o.useCallback(S=>N?I("wordPairs.phonemeContrastOrdinalLabel",{ordinal:T[S-1]??S}):a===1?I("wordPairs.phonemeContrastSingleLabel","\uB300\uB9BD \uC74C\uC808"):I("wordPairs.phonemeContrast",{n:S}),[N,T,a,I]),Q=o.useCallback((S,R)=>R?n.jsxs(n.Fragment,{children:[S,n.jsx("span",{className:"phoneme-select-block__required",children:"*"})]}):S,[]),{anchorRect:H,toggleAt:O,close:U}=Pa(),$=o.useCallback(S=>r(Number(S)),[r]),V=un("(max-width: 767px)"),z=o.useCallback(S=>L_(S,e).map(({label:R,value:F,displayLabel:Z})=>{const pe=!!F&&F!=="\uC5C6\uC74C";return n.jsxs("span",{className:_e("phoneme-select-block__cell-jamo-part",F?"":"phoneme-select-block__cell-jamo-part--empty",pe?"":"phoneme-select-block__cell-jamo-part--no-label"),children:[n.jsx("span",{className:`phoneme-select-block__cell-jamo-char h1${F==="\uC5C6\uC74C"?" phoneme-select-block__cell-jamo-char--excluded":""}`,children:F==="\uC5C6\uC74C"?"x":F||d}),pe&&n.jsx("span",{className:"phoneme-select-block__cell-jamo-label caption-2",children:Z??R})]},R)}),[e,d]),Y=n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-tooltip-ignore":!0,children:n.jsx(fe,{htmlType:"button",size:40,type:V?"dot":void 0,icon:"info",label:V?void 0:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),ariaLabel:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),className:H?"is-selected":void 0,"aria-expanded":!!H,"aria-haspopup":"dialog",onClick:S=>O(S.currentTarget)})}),H&&n.jsx(Kn,{title:I("wordPairs.caution","\uC720\uC758\uC0AC\uD56D"),items:P,anchorRect:H,onClose:U})]});return n.jsxs(Ca,{type:v,title:p,icon:f,disc:b,action:x?Y:void 0,className:_e("phoneme-select-block",m),children:[k,!D&&n.jsx("div",{className:"phoneme-select-block__controls",children:n.jsx(bn,{options:K,value:String(a),onChange:$,size:40,ariaLabel:I("wordPairs.countLabel","\uC74C\uC18C \uAC1C\uC218"),className:"phoneme-select-block__count-control"})}),n.jsx("div",{className:"phoneme-select-block__cells",children:w?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R)})}),n.jsx("span",{className:"phoneme-select-block__cell-vs h3",children:I("wordPairs.phonemeSelect.vs","\uB300")}),n.jsx("div",{className:"phoneme-select-block__cell-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(F)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:L(R+1)})]},R)})})]}):t.map((S,R)=>n.jsxs("div",{className:"phoneme-select-block__cell",children:[n.jsx("div",{className:"phoneme-select-block__cell-circle",children:n.jsx("div",{className:"phoneme-select-block__cell-jamo",children:z(S)})}),n.jsx("span",{className:"phoneme-select-block__cell-index caption-1",children:M(R+1)})]},R))}),(i||u)&&n.jsx("div",{className:"phoneme-select-block__panels",children:n.jsx("div",{className:"phoneme-select-block__detail",children:w?n.jsxs("div",{className:"phoneme-select-block__pair-panels",children:[n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2]??{};return n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(F,R*2):i,selected:F,onSelect:c?.(R*2),align:"newline"},R)})}),n.jsx("div",{className:"phoneme-select-block__panel-group",children:Array.from({length:a}).map((S,R)=>{const F=t[R*2+1]??{};return n.jsx(En,{title:L(R+1),sections:u?u(F,R*2+1):i,selected:F,onSelect:c?.(R*2+1),align:"newline"},R)})})]}):t.map((S,R)=>n.jsx(En,{title:Q(M(R+1),R===0),sections:u?u(S,R):i,selected:S,onSelect:c?.(R),align:"newline"},R))})}),B&&n.jsx("div",{className:"phoneme-select-block__before-search",children:B}),(C||h||y)&&(()=>{const S=t.every(R=>{const F=Jf(R);return Object.entries(F).every(([Z,pe])=>!pe||Z==="coda"&&pe===jl)});return n.jsxs("div",{className:"phoneme-select-block__search-row",onClick:S?_:void 0,children:[C&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:I("wordPairs.resetOptions","\uAC80\uC0C9 \uC635\uC158 \uCD08\uAE30\uD654"),selected:!1,disabled:S,onClick:S?void 0:C}),h?n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",icon:y?n.jsx("span",{className:"phoneme-select-block__spinner","aria-hidden":"true"}):void 0,label:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30"),disabled:S||g||y,onDisabledClick:y?()=>{}:void 0,"aria-busy":y||void 0,onClick:h}):y?n.jsxs("div",{className:"phoneme-select-block__checking","aria-busy":"true",children:[n.jsx("div",{className:"phoneme-select-block__spinner"}),n.jsx("span",{className:"button-1 phoneme-select-block__checking-label",children:A??I("wordSearch.searchButton","\uAC80\uC0C9\uD558\uAE30")})]}):null]})})(),E]})}function R_({title:e,sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,className:m}){const{t:p}=xe.useTranslation();return n.jsx(En,{className:m,title:e??p("wordSearch.filterTitle","\uB2E8\uC5B4 \uAC80\uC0C9 \uC124\uC815"),sections:t,selected:a,onSelect:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,headerAction:d,align:"inline"})}function P_({title:e,headerAction:t,sections:a,selected:r,onSelect:l,className:s}){const{t:i}=xe.useTranslation();return a.length===0?null:n.jsx(En,{className:s,title:e??i("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),headerAction:t,sections:a,selected:r,onSelect:l,align:"newline"})}function I_({title:e,mode:t,onModeChange:a,matchMode:r,onMatchModeChange:l,positionCount:s,onPositionCountChange:i,inputMode:u,onInputModeChange:c,className:d}){const{t:m}=xe.useTranslation(),p={searchMode:m("wordPairs.filter.searchModeLabel","\uB300\uB9BD \uBC29\uC2DD"),phonemeOrder:m("wordPairs.filter.phonemeOrder","\uC785\uB825 \uC74C\uC808 \uC704\uCE58"),count:m("wordPairs.filter.countLabel","\uC785\uB825 \uC74C\uC808 \uAC2F\uC218"),inputMode:m("wordPairs.filter.inputModeLabel","\uC785\uB825 \uBC29\uC2DD"),orderAny:m("wordPairs.filter.orderAny","\uBB34\uAD00"),orderMatch:m("wordPairs.filter.orderMatch","\uC77C\uCE58"),include:m("wordPairs.mode.include","\uC74C\uC18C \uD3EC\uD568"),pick:m("wordPairs.mode.pick","\uC74C\uC18C \uB300\uB9BD"),explicit:m("wordPairs.mode.contrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815"),charInput:m("wordPairs.input.char","\uAE00\uC790 \uC120\uD0DD"),pronInput:m("wordPairs.input.pron","\uBC1C\uC74C \uC120\uD0DD")},f=h=>m("wordPairs.count",{n:h}),b=[{label:p.searchMode,items:[p.include,p.pick,p.explicit],display:"segmented",labelAction:n.jsx(Ha,{title:m("wordPairs.mode.infoTitle","\uB300\uB9BD \uBC29\uC2DD"),items:[m("wordPairs.mode.infoInclude","\uC74C\uC18C \uD3EC\uD568 \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uBAA8\uB450 \uB4E4\uC5B4\uAC04 \uB2E8\uC5B4\uC640 \uADF8 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694."),m("wordPairs.mode.infoPick","\uC74C\uC18C \uB300\uB9BD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uAC00 \uB300\uB9BD\uC30D \uB450 \uB2E8\uC5B4\uC758 \uC2E4\uC81C \uCC28\uC774\uC810\uC77C \uB54C\uB9CC \uB9E4\uCE6D\uB3FC\uC694."),m("wordPairs.mode.infoContrast","\uC74C\uC18C \uB300\uB9BD \uC9C0\uC815 \u2014 \uAE30\uC900 \uB2E8\uC5B4\uC640 \uB300\uB9BD \uB2E8\uC5B4\uC758 \uC74C\uC18C\uB97C \uAC01\uAC01 \uC9C1\uC811 \uC120\uD0DD\uD574 \uB300\uB9BD\uC30D\uC744 \uCC3E\uC544\uC694.")]})},{label:p.phonemeOrder,items:[p.orderAny,p.orderMatch],display:"segmented",labelAction:n.jsx(Ha,{items:m("wordPairs.filter.phonemeOrderInfo",{returnObjects:!0})})},{label:p.count,items:[f(1),f(2)],display:"segmented"},{label:p.inputMode,items:[p.charInput,p.pronInput],display:"segmented",labelAction:n.jsx(Ha,{title:m("wordPairs.input.infoTitle","\uC785\uB825 \uBC29\uC2DD"),items:[m("wordPairs.input.infoChar","\uAE00\uC790 \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uB2E8\uC5B4(\uAE00\uC790 \uAE30\uC900)\uB97C \uCC3E\uC740 \uD6C4, \uB2E8\uC5B4\uC758 \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4."),m("wordPairs.input.infoPron","\uBC1C\uC74C \uC120\uD0DD \u2014 \uC120\uD0DD\uD55C \uC74C\uC18C\uB85C \uD45C\uC900 \uBC1C\uC74C \uB300\uB9BD\uC30D\uC744 \uCC3E\uC2B5\uB2C8\uB2E4.")]})}],x={[p.searchMode]:t==="explicit"?p.explicit:t==="pick"?p.pick:p.include,[p.phonemeOrder]:r==="ordered"?p.orderMatch:p.orderAny,[p.count]:f(s),[p.inputMode]:u==="phoneme"?p.pronInput:p.charInput},C=(h,_)=>{_===p.searchMode?a(h===p.explicit?"explicit":h===p.pick?"pick":"include"):_===p.phonemeOrder?l(h===p.orderMatch?"ordered":"unordered"):_===p.count?i(h===f(2)?2:1):_===p.inputMode&&c(h===p.pronInput?"phoneme":"word")};return n.jsx(En,{className:d,title:e??m("wordPairs.filter.searchOptionsTitle","\uB300\uB9BD \uC124\uC815"),sections:b,selected:x,onSelect:C,align:"inline"})}function F_(e){const{title:t,items:a,columns:r,resizeStorageKey:l,gridTemplateColumns:s,mobileGridTemplateColumns:i,searchPlaceholder:u,searchFn:c,defaultSortKey:d,defaultSortAsc:m=!0,selectedId:p,selectedIds:f,onSelect:b,onClose:x,pageSizeOptions:C=[10,25,50,100],initialPageSize:h,emptyText:_,noMatchText:g,countLabel:A,topContent:y,className:w=""}=e,{t:v}=xe.useTranslation(),B=u??v("common.search","\uAC80\uC0C9"),k=_??v("common.emptyList","\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."),E=g??v("common.noMatches","\uB9DE\uB294 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"),[D,N]=o.useState(""),[I,P]=o.useState(d??r[0]?.key??""),[K,T]=o.useState(m),[M,L]=o.useState(String(h??C[0]??10)),[Q,H]=o.useState(1);o.useEffect(()=>{H(1)},[D,M]);const O=c!==null,U=o.useCallback((re,oe)=>{if(!oe)return!0;const ne=oe.toLowerCase();return r.some(W=>{const ie=re[W.key];return ie==null?!1:String(ie).toLowerCase().includes(ne)})},[r]),$=c??U,V=o.useMemo(()=>{const re=O?a.filter(oe=>$(oe,D)):a;return I?[...re].sort((oe,ne)=>{const W=oe[I],ie=ne[I];return W===ie?0:Bo(W,ie,K)}):re},[a,D,I,K,O,$]),z=Math.max(1,Math.ceil(V.length/Number(M)));Q>z&&H(z);const Y=Math.min(Q,z),S=V.slice((Y-1)*Number(M),Y*Number(M)),R=o.useCallback(re=>{I===re?T(oe=>!oe):(P(re),T(!0)),H(1)},[I]),F=o.useMemo(()=>{if(typeof A=="function"){const re=V.length,oe=A(re);if(typeof oe=="string"){const ne=oe.lastIndexOf(String(re));if(ne>=0)return{prefix:oe.slice(0,ne),suffix:oe.slice(ne+String(re).length)}}return{label:oe}}if(typeof A=="string"&&A.includes("{n}")){const[re,oe]=A.split("{n}");return{prefix:re,suffix:oe}}return{prefix:v("common.totalCountPrefix","\uCD1D "),suffix:v("common.totalCountSuffix","\uAC1C")}},[A,V.length,v]),Z=o.useMemo(()=>r.map(re=>({label:re.label,onClick:re.sortable!==!1?()=>R(re.key):void 0,className:re.className,sortDir:re.sortable!==!1&&I===re.key?K?"asc":"desc":null})),[r,I,K,R]),pe=o.useMemo(()=>C.map(re=>({value:String(re),label:v("common.pageSizeLabel",{n:re})})),[C,v]);return n.jsxs(On,{className:`popup-list ${w}`,title:t,onClose:x,children:[y,"label"in F&&n.jsx("p",{className:"toolbar__count body-1",children:F.label}),n.jsx(Po,{count:"label"in F?void 0:{value:V.length,prefix:F.prefix,suffix:F.suffix},search:O?{value:D,onChange:N,placeholder:B}:void 0,pageSize:{options:pe,value:M,onChange:L},pagination:{page:Y,total:z,onChange:H}}),n.jsx(Ko,{size:"medium",gridTemplateColumns:s,mobileGridTemplateColumns:i,resizable:!0,resizeStorageKey:l,fields:Z,items:S,onRowClick:b,renderRow:re=>{const oe=f!=null?re.id!=null&&f.has(re.id):p!=null&&re.id===p;return r.map(ne=>({content:ne.render?ne.render(re):re[ne.key]??"",className:_e(ne.className,oe&&"popup-list__row--selected")}))},empty:O&&D!==""&&a.length>0?E:k})]})}function id(e){const{title:t,message:a,topContent:r,details:l,children:s,confirmLabel:i,cancelLabel:u,hideCancel:c=!1,extraAction:d,confirmVariant:m="main",confirmDisabled:p=!1,onConfirm:f,closeOnConfirm:b=!0,onClose:x,inline:C,size:h="small",className:_,initialFocus:g="close"}=e,{t:A}=xe.useTranslation(),y=o.useRef(null);o.useEffect(()=>{if(C||g==="close")return;const D=y.current?.closest(".popup-panel"),N=Array.from(D?.querySelectorAll(".popup-footer--buttons button")??[]),I=g==="confirm"?N[N.length-1]:c?void 0:N[d?1:0];I&&!I.disabled&&I.focus()},[]);const w=o.useRef(!1),[v,B]=o.useState(!1),k=D=>{let N=!1;return{close:()=>{N=!0,D()},didClose:()=>N}},E=async D=>{if(w.current)return;w.current=!0;const N=typeof document<"u"?document.activeElement:null;B(!0);let I=!1;try{I=await D()}catch(P){typeof console<"u"&&console.error(P)}finally{I||(w.current=!1,B(!1),requestAnimationFrame(()=>{const P=document.activeElement;(!P||P===document.body)&&N?.isConnected&&N.focus()}))}};return n.jsxs(On,{title:t,onClose:x,closeDisabled:v,inline:C,size:h,className:_e("confirm-popup",r!=null&&"confirm-popup--has-top",_),buttons:[...d?[{label:d.label,variant:d.variant??"default",disabled:d.disabled||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);await d.onClick(N.close);const I=d.closeOnClick??!0;return I&&D(),I||N.didClose()})}}]:[],...c?[]:[{label:u??A("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:v,onClick:({closeWithAnimation:D})=>D()}],{label:i??A("common.confirm","\uD655\uC778"),variant:m,disabled:p||v,onClick:async({closeWithAnimation:D})=>{await E(async()=>{const N=k(D);return await f(N.close),b&&D(),b||N.didClose()})}}],children:[r!=null&&n.jsx("div",{className:"confirm-popup__top",children:r}),l&&l.length>0&&n.jsx(Ar,{children:l.map((D,N)=>n.jsx(Dn,{label:D.label,children:n.jsx("span",{className:"panel-row__text body-2",children:D.value})},N))}),n.jsx("p",{ref:y,className:"body-2 confirm-popup__message",children:a}),s]})}function O_(e,t,a={}){const{t:r}=xe.useTranslation(),[l,s]=o.useState(!1),i=o.useRef(!1),u=o.useCallback(()=>{i.current=!0},[]),c=o.useCallback(()=>i.current?(i.current=!1,!0):e?(s(!0),!1):!0,[e]),d=l?n.jsx(id,{title:a.title??r("common.discardConfirm.title","\uC785\uB825\uC744 \uCDE8\uC18C\uD560\uAE4C\uC694?"),message:a.message??r("common.discardConfirm.body","\uC800\uC7A5\uD558\uC9C0 \uC54A\uC73C\uBA74 \uC9C0\uAE08\uAE4C\uC9C0 \uC785\uB825\uD55C \uB0B4\uC6A9\uC774 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."),confirmLabel:a.confirmLabel??r("common.discardConfirm.confirm","\uC785\uB825 \uCDE8\uC18C"),confirmVariant:"danger",onConfirm:()=>{s(!1),t()},onClose:()=>s(!1)}):null;return{beforeClose:c,discardPopup:d,allowClose:u}}function z_({onApply:e,onCancel:t}){const{t:a}=xe.useTranslation(),[r,l]=o.useState(""),[s,i]=o.useState(!1),[u,c]=o.useState(null),d=o.useRef(null),m=o.useId();o.useEffect(()=>{d.current?.focus()},[]);const p=o.useCallback(async x=>{const C=r.trim();if(C){i(!0),c(null);try{await e(C),x()}catch(h){c($l(h)),i(!1),requestAnimationFrame(()=>d.current?.focus())}}},[r,e]),f=o.useCallback((x,C)=>{x.key==="Enter"&&!x.nativeEvent.isComposing&&p(C)},[p]),b=x=>{l(x.target.value),c(null)};return n.jsx(On,{className:"coupon-input-popup",title:a("usage.couponButton","\uCFE0\uD3F0 \uC785\uB825"),size:"small",onClose:t,closeDisabled:s,buttons:[{label:a("common.cancel","\uCDE8\uC18C"),variant:"default",disabled:s,onClick:({closeWithAnimation:x})=>x()},{label:a("coupons.applyButton","\uC801\uC6A9"),variant:"main",disabled:!r.trim()||s,onClick:({closeWithAnimation:x})=>{p(x)}}],children:({closeWithAnimation:x})=>n.jsxs(n.Fragment,{children:[n.jsx("input",{ref:d,className:"coupon-input-popup__input body-2","aria-label":a("coupons.input.label","\uCFE0\uD3F0 \uCF54\uB4DC"),"aria-invalid":u?!0:void 0,"aria-errormessage":u?m:void 0,"aria-describedby":u?m:void 0,placeholder:a("coupons.input.placeholder","\uCFE0\uD3F0 \uCF54\uB4DC \uC785\uB825"),value:r,onChange:b,onKeyDown:C=>f(C,x),disabled:s,autoComplete:"off",spellCheck:!1}),u&&n.jsx("p",{id:m,className:"coupon-input-popup__error caption-1",role:"alert",children:u})]})})}const ud=["var(--color-main)","var(--color-sub)"],W_=2e3;function H_(e,t){if(!t.startsWith("var("))return t;try{const a=t.slice(4,-1).trim();return getComputedStyle(e).getPropertyValue(a).trim()||null}catch{return null}}function Ns({active:e=!1,count:t=40,duration:a=2e3,strength:r=1,onComplete:l,trigger:s=0}){const i=o.useMemo(()=>{const C=Math.floor(t/2),h=t-C,_=(g,A)=>Array.from({length:g}).map((y,w)=>{const v=6+Math.random()*12,B=Math.round(Math.min(18,v*Math.min(1.5,1+r*.4))),k=ud[Math.floor(Math.random()*ud.length)],E=Math.random()*300,D=(360+Math.random()*260)*r*1.2,N=(A==="left"?-95+Math.random()*40:-85-Math.random()*40)*Math.PI/180,I=Math.cos(N)*D,P=Math.sin(N)*D*1.35,K=Math.random()*720-360,T=(1200+Math.random()*3e3)*Math.min(1.6,1+r*.3),M=Math.random()>.7?"50%":"3px";return{id:`${A}-${w}`,side:A,size:B,color:k,delay:E,vx:I,vy:P,angularVel:K,life:T,borderRadius:M}});return[..._(C,"left"),..._(h,"right")]},[t,r]),u=o.useRef(null),c=o.useRef({}),d=o.useRef(null),m=o.useRef(l);o.useEffect(()=>{m.current=l},[l]);const p=o.useRef(null),f=o.useRef(null),b=()=>{if(typeof document>"u")return null;let C=document.querySelector("[data-ihab-effect-root]");return C||(C=document.createElement("div"),C.className="app-effect",C.dataset.ihabEffectRoot="",C.style.position="fixed",C.style.inset="0",C.style.pointerEvents="none",C.style.zIndex="99998",document.body.appendChild(C)),C};if(typeof document<"u"&&f.current==null&&(f.current=b()),o.useEffect(()=>{if(!e)return;if(typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches){const U=setTimeout(()=>m.current?.(),0);return()=>clearTimeout(U)}const C=1200,h=performance.now(),_=f.current&&f.current!==document.body?f.current.getBoundingClientRect():null,g=Math.max(60,(window.innerHeight||800)*.05),A=U=>Math.max(40,(U||window.innerWidth)*.02),y=_?.width||window.innerWidth||375,w=_?.height||window.innerHeight||812,v=U=>{const $=[...U].sort((V,z)=>V-z);return $[Math.floor($.length/2)]||1},B=v(i.map(U=>Math.abs(U.vy))),k=v(i.map(U=>Math.abs(U.vx))),E=Math.sqrt(2*C*(w*.72+g))/B,D=B*E/C,N=y*.5/(k*D),I=(U,$,V)=>Math.min(V,Math.max($,U)),P=I(E,.8,2.4),K=I(N,.7,2.2),T=a>0?a/W_:1,M=i.map(U=>({...U,life:U.life*T,vx:U.vx*K,vy:U.vy*P,startTime:h+U.delay,ended:!1})),L=_?{x:_.left-A(_.width),y:_.top+_.height+g}:{x:-A(window.innerWidth),y:window.innerHeight+g},Q=_?{x:_.left+_.width+A(_.width),y:_.top+_.height+g}:{x:window.innerWidth+A(window.innerWidth),y:window.innerHeight+g},H=U=>{let $=!1;for(const V of M){const z=c.current[V.id];if(!z||!z)continue;if(U<V.startTime){z.style.display="none",$=!0;continue}if(!V._inited){const W=V.side==="left"?L.x:Q.x,ie=V.side==="left"?L.y:Q.y;z.style.left=`${W}px`,z.style.top=`${ie}px`,z.style.transform="translate3d(0px, 0px, 0)",z.style.display="block",z.style.zIndex="100000",typeof V.color=="string"&&V.color.startsWith("var(")&&(z.style.background=H_(z,V.color)??"#FF0060"),V._inited=!0}const Y=(U-V.startTime)/1e3;if(Y<0)continue;const S=V.life/1e3;if(Y>=S){z.style.opacity="0",z.style.display="none",V.ended=!0;continue}$=!0;const R=V.side==="left"?L.x:Q.x,F=V.side==="left"?L.y:Q.y,Z=R+V.vx*Y,pe=F+V.vy*Y+.5*C*Y*Y,re=(V.angularVel||0)*Y,oe=Z-R,ne=pe-F;z.style.transform=`translate3d(${oe}px, ${ne}px, 0) rotate(${re}deg)`,z.style.opacity=`${Math.max(0,1-Y/S)}`}$?d.current=requestAnimationFrame(H):m.current?.()};d.current=requestAnimationFrame(H);const O=setTimeout(()=>{try{if((f.current?f.current.querySelectorAll(".confetti"):document.querySelectorAll(".confetti")).length===0&&!document.querySelector(".party-container")){const U=document.createElement("div");U.className="party-container",U.style.position="fixed",U.style.inset="0",U.style.pointerEvents="none",U.style.overflow="visible",U.style.zIndex="2147483647";for(const $ of i){const V=document.createElement("span");V.className=`confetti confetti--${$.side}`,V.setAttribute("aria-hidden","true"),V.style.display="none",V.style.position="fixed",V.style.left="0px",V.style.top="0px",V.style.width=`${$.size}px`,V.style.height=`${Math.max(4,$.size*.6)}px`,V.style.background=$.color,V.style.borderRadius=$.borderRadius,V.style.transform="translate3d(0,0,0)",V.style.opacity="0",U.appendChild(V),c.current[$.id]=V}(document.body||f.current).appendChild(U),p.current=U}}catch{}},300);return()=>{if(d.current&&cancelAnimationFrame(d.current),clearTimeout(O),p.current){try{p.current.remove()}catch{}p.current=null}}},[e,a,s,i]),!e)return null;const x=n.jsx("div",{className:"party-container",ref:u,children:i.map(C=>n.jsx("span",{"aria-hidden":!0,ref:h=>{c.current[C.id]=h},className:`confetti confetti--${C.side}`,style:{width:`${C.size}px`,height:`${Math.max(4,C.size*.6)}px`,background:C.color,borderRadius:C.borderRadius}},`${C.id}-${s}`))});return typeof document<"u"?nn.createPortal(x,f.current||document.body):x}const Es=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0;function V_({trigger:e=0,active:t=!1}){const[a,r]=o.useState(null);o.useEffect(()=>{if(typeof window>"u")return;const s=i=>{const u=i.detail??{};r(c=>({n:(c?.n??0)+1,count:Es(u.count),strength:Es(u.strength),duration:Es(u.duration)}))};return window.addEventListener("party:trigger",s),()=>window.removeEventListener("party:trigger",s)},[]);const l=o.useCallback(()=>r(null),[]);return n.jsxs(n.Fragment,{children:[n.jsx(Ns,{active:t,trigger:e}),a&&n.jsx(Ns,{active:!0,trigger:a.n,count:a.count,strength:a.strength,duration:a.duration,onComplete:l})]})}function q_({title:e,sub:t,rightAction:a,titleAction:r,badge:l,badgeVariant:s="default",documentTitle:i,onBack:u,backLabel:c,wrap:d=!1}){const{t:m}=xe.useTranslation();hy(typeof e=="string"?e:i??null);const p=c??m("common.back","\uB4A4\uB85C");return n.jsxs("div",{className:d?"page-title page-title--wrap":"page-title",children:[n.jsxs("div",{className:"page-title__main",children:[n.jsxs("div",{className:"page-title__title-row",children:[u&&n.jsx(fe,{htmlType:"button",className:"page-title__back",size:48,type:"dot",icon:"chevron-left",iconSize:"large",useBorder:!1,iconColor:"var(--color-text-primary)",ariaLabel:p,showTooltipInfo:p,onClick:u}),n.jsx("h1",{className:"page-title__title h1",children:e}),l&&n.jsx("div",{className:"page-title__badge",children:n.jsx(Et,{label:l,size:"small",variant:s,fill:"outline"})}),r?n.jsx("div",{className:"page-title__title-action",children:r}):null]}),t&&n.jsx("p",{className:"page-title__sub body-2",children:t})]}),a?n.jsx("div",{className:"page-title__action",children:a}):null]})}function U_(e){return e??""}const cd=o.createContext({words:[],loading:!1});function G_(){return o.useContext(cd)}function K_({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c,children:d}){const m=o.useMemo(()=>({words:e,loading:t,error:a,statusMessage:r,localVersion:l,remoteVersion:s,progress:i,clearAndRefetch:u,checkRemoteVersion:c}),[e,t,a,r,l,s,i,u,c]);return n.jsx(cd.Provider,{value:m,children:d})}function Y_({items:e,actions:t,columns:a,flat:r=!1,className:l,style:s}){const i=a??e.length;return n.jsx("section",{className:_e("summary-strip",r&&"summary-strip--flat",l),style:{"--summary-strip-cols":String(i),...s},children:n.jsxs("div",{className:"summary-strip__row",children:[n.jsx("div",{className:"summary-strip__items",children:e.map((u,c)=>n.jsxs("div",{className:"summary-strip__item",children:[n.jsx("p",{className:"summary-strip__label caption-1",children:u.label}),n.jsx("p",{className:"summary-strip__value body-3b",title:typeof u.value=="string"||typeof u.value=="number"?String(u.value):void 0,children:u.value})]},c))}),t&&n.jsx("div",{className:"summary-strip__actions",children:t})]})})}const Z_=(e,t)=>`${e} / ${t}`;function X_({blocks:e,sectionTitles:t,logo:a,footer:r,pageLabel:l=Z_,pageWidth:s,pageHeight:i,margin:u,className:c,style:d}){const{t:m}=xe.useTranslation(),p=o.useRef(null),f=o.useRef(null),b=o.useRef(null),x=o.useRef(null),[C,h]=o.useState(null),[_,g]=o.useState(!1);o.useEffect(()=>{const T=p.current;if(!T)return;const M=()=>g(T.scrollWidth>T.clientWidth+1);if(M(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(M);return L.observe(T),()=>L.disconnect()},[C]);const A=e.map(T=>`${T.id}\0${T.section??""}\0${T.group??""}`).join(""),y=C&&C.shape===A?C.pages:null,[w,v]=o.useState(0);o.useEffect(()=>{const T=x.current;if(!T||typeof ResizeObserver>"u")return;const M=new ResizeObserver(()=>v(T.offsetHeight));return M.observe(T),()=>M.disconnect()},[]);const[B,k]=o.useState(0);o.useEffect(()=>{const T=f.current;if(!T||typeof ResizeObserver>"u")return;let M=null;const L=typeof requestAnimationFrame=="function"?O=>requestAnimationFrame(O):O=>setTimeout(O,16),Q=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:O=>clearTimeout(O),H=new ResizeObserver(()=>{M==null&&(M=L(()=>{M=null,k(O=>O+1)}))});return Array.from(T.children).forEach(O=>H.observe(O)),()=>{H.disconnect(),M!=null&&Q(M)}},[A]),o.useLayoutEffect(()=>{const T=f.current,M=x.current;if(!T||!M)return;const L=S=>S.getBoundingClientRect().height||S.offsetHeight,Q=new Map;b.current?.querySelectorAll("[data-chrome-section]").forEach(S=>{Q.set(S.dataset.chromeSection??"",L(S))});const H=S=>L(M)-(Q.get(S??"")??0),O=Array.from(T.children).map(S=>L(S)),U=[];e.forEach((S,R)=>{const F=U[U.length-1],Z=F?e[F[0]]:void 0;Z&&S.group!=null&&Z.group===S.group&&Z.section===S.section?F.push(R):U.push([R])});const $=[];let V=[],z=0;const Y=()=>{V.length&&$.push(V),V=[],z=0};U.forEach(S=>{const R=S.reduce((Z,pe)=>Z+O[pe],0),F=H(e[S[0]].section);V.length&&e[V[0]].section!==e[S[0]].section&&Y(),R>F?S.forEach(Z=>{V.length&&z+O[Z]>F+.01&&Y(),V.push(Z),z+=O[Z]}):(V.length&&z+R>F+.01&&Y(),S.forEach(Z=>V.push(Z)),z+=R)}),Y(),h(S=>S&&S.shape===A&&JSON.stringify(S.pages)===JSON.stringify($)?S:{shape:A,pages:$})},[A,w,s,i,u,B]);const E=Mo,D=E,N=r??n.jsxs(n.Fragment,{children:[n.jsx("img",{src:D,alt:"IHAB",className:"report-doc__logo"}),"\xA9 IHAB, Inc. All rights reserved."]}),I=(T,M,L)=>({header:n.jsxs("div",{className:"report-doc__header",children:[n.jsx("h2",{className:"report-doc__title h3b",children:L!=null&&t?.[L]||null}),a]}),footer:n.jsxs("div",{className:"report-doc__footer caption-1",children:[n.jsx("span",{className:"report-doc__footer-left",children:N}),n.jsx("span",{className:"report-doc__page-no",children:l(T,M)})]})}),P=Array.from(new Set(e.map(T=>T.section??""))),K={...s?{"--report-page-w":s}:null,...i?{"--report-page-h":i}:null,...u?{"--report-margin":u}:null,...d};return n.jsxs("div",{ref:p,className:_e("report-doc",c),style:K,tabIndex:_?0:void 0,role:_?"group":void 0,"aria-label":_?m("report.previewRegion","\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30"):void 0,children:[n.jsxs("div",{className:"report-doc__measure","aria-hidden":!0,children:[n.jsx("div",{ref:x,className:"report-doc__ruler"}),n.jsx("div",{ref:b,children:P.map(T=>{const M=I(1,1,T||void 0);return n.jsxs("div",{"data-chrome-section":T,children:[M.header,M.footer]},T)})}),n.jsx("div",{ref:f,className:"report-doc__measure-blocks",children:e.map(T=>n.jsx("div",{children:T.content},T.id))})]}),y&&n.jsx("div",{className:"report-doc__pages",children:y.map((T,M)=>{const{header:L,footer:Q}=I(M+1,y.length,e[T[0]].section);return n.jsxs("section",{className:"report-doc__page",children:[L,T.map(H=>n.jsx("div",{children:e[H].content},e[H].id)),Q]},M)})})]})}function J_({title:e,fields:t,columns:a=4,className:r,style:l}){return n.jsxs("div",{className:_e("report-info",r),style:{"--report-info-cols":String(a),...l},children:[e&&n.jsx("p",{className:"report-info__title h5b",children:e}),n.jsx("div",{className:"report-info__grid",children:t.map((s,i)=>n.jsxs("div",{className:"report-info__field body-2",children:[n.jsx("span",{className:"report-info__label body-3",children:s.label}),n.jsx("span",{className:"report-info__value",children:s.value})]},i))})]})}const na=new Map;let Mr=null;const Q_=12;function ew(e){for(let t=e.parentElement;t&&t!==document.body;t=t.parentElement){const a=window.getComputedStyle(t);if(a.transform&&a.transform!=="none"||a.filter&&a.filter!=="none"||a.perspective&&a.perspective!=="none"||/paint|layout|strict|content/.test(a.contain||""))return t}return document}function Lr(){const e=new Map;for(const t of na.keys()){if(!t.isConnected)continue;const a=ew(t),r=e.get(a)??[];r.push(t),e.set(a,r)}for(const t of e.values()){t.sort((r,l)=>r.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let a=0;for(const r of t){a>0?r.style.setProperty("--update-alert-stack-offset",`${a}px`):r.style.removeProperty("--update-alert-stack-offset");const l=r.getBoundingClientRect().height;l>0&&(a+=l+Q_)}}}function tw(e){return typeof window>"u"?()=>{}:(na.set(e,(na.get(e)??0)+1),na.get(e)===1&&typeof ResizeObserver<"u"&&(Mr??(Mr=new ResizeObserver(()=>Lr())),Mr.observe(e)),Lr(),()=>{const t=(na.get(e)??1)-1;if(t>0){na.set(e,t),Lr();return}na.delete(e),Mr?.unobserve(e),e.style.removeProperty("--update-alert-stack-offset"),Lr()})}function nw({title:e,message:t,actionLabel:a,onAction:r,icon:l,onClose:s,className:i=""}){const{t:u}=xe.useTranslation(),c=a??u("common.update","\uC5C5\uB370\uC774\uD2B8"),d=o.useRef(null),m=o.useRef(!1);return o.useLayoutEffect(()=>{const p=d.current,f=p?.parentElement?.closest(".update-alert-stack")??p,b=f?tw(f):null;return()=>{b?.(),m.current&&p&&p.contains(document.activeElement)&&sr(p)}},[]),n.jsxs("div",{ref:d,className:_e("update-alert",i),role:"alert",children:[s&&n.jsx("button",{type:"button",className:"update-alert__close",onClick:()=>{m.current=!0,s()},"aria-label":u("common.close","\uB2EB\uAE30"),children:"\xD7"}),n.jsxs("div",{className:"update-alert__top",children:[n.jsx("div",{className:"update-alert__icon",children:l??n.jsx(Os,{size:20,strokeWidth:2})}),n.jsxs("div",{className:"update-alert__body",children:[n.jsx("div",{className:"update-alert__title h4",children:e}),n.jsx("div",{className:"update-alert__message body-3",children:t})]})]}),r&&n.jsx(fe,{htmlType:"button",size:32,variant:"main",shape:"pill",className:"update-alert__action",onClick:r,children:c})]})}function aw({title:e,titleLevel:t=3,description:a,topActions:r,children:l,footerLeft:s,footerRight:i,ariaLabel:u,onClick:c,draggable:d,onDragStart:m,onDragEnd:p,className:f}){const b=t?`h${t}`:"div",x=s!=null||i!=null,C=l!=null&&l!==!1,h=o.useCallback(_=>{c&&_.target===_.currentTarget&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),c())},[c]);return n.jsxs("div",{className:_e("training-card",c?"training-card--clickable":"",f),onClick:c,onKeyDown:c?h:void 0,role:c?"button":void 0,"aria-label":c?u??(typeof e=="string"?e:void 0):void 0,tabIndex:c?0:void 0,draggable:d,onDragStart:m,onDragEnd:p,children:[n.jsxs("div",{className:"training-card__header",children:[n.jsxs("div",{className:"training-card__title-row",children:[typeof e=="string"?n.jsx(b,{className:"training-card__title h4",children:e}):e,r!=null&&n.jsx("div",{className:"training-card__top-actions",onClick:_=>_.stopPropagation(),children:r})]}),a!=null?typeof a=="string"?n.jsx("p",{className:"training-card__description body-3",children:a}):a:n.jsx("p",{className:"training-card__description body-3","aria-hidden":"true",children:" "})]}),C&&n.jsx("div",{className:"training-card__body",children:l}),x&&n.jsxs("div",{className:"training-card__footer",children:[s!=null&&n.jsx("div",{className:"training-card__footer-left",children:s}),i!=null&&n.jsx("div",{className:"training-card__meta",children:i})]})]})}function rw({title:e,titleLevel:t=3,count:a,collapsed:r=!1,onToggle:l,beforeSort:s,sort:i,actions:u,empty:c=!1,emptyContent:d,dragOver:m=!1,onDragOver:p,onDragLeave:f,onDrop:b,children:x,className:C}){const{t:h}=xe.useTranslation(),_=o.useId(),g=t?`h${t}`:"span",A=l!=null,y=_e("training-card-group",m&&"training-card-group--dragover",r&&"training-card-group--collapsed",A&&"training-card-group--collapsible",C);return n.jsxs("div",{className:y,onDragOver:p,onDragLeave:f,onDrop:b,role:typeof e=="string"&&e?"group":void 0,"aria-labelledby":typeof e=="string"&&e?_:void 0,children:[n.jsxs("header",{className:"training-card-group__header",children:[A&&n.jsx(fe,{htmlType:"button",size:40,type:"dot",variant:"transparent-gray",useBorder:!1,icon:r?"chevron-right":"chevron-down",ariaLabel:typeof e=="string"&&e?r?h("common.expandFor",{name:e}):h("common.collapseFor",{name:e}):r?h("common.expand","\uD3BC\uCE58\uAE30"):h("common.collapse","\uC811\uAE30"),className:"training-card-group__chevron","aria-expanded":!r,onClick:l}),typeof e=="string"?n.jsx(g,{id:_,className:"training-card-group__title h5b",children:e}):e,a!==void 0&&n.jsx("span",{className:"training-card-group__count body-3b",children:a}),(s!=null||i||u!=null)&&n.jsxs("span",{className:"training-card-group__actions",onClick:w=>w.stopPropagation(),children:[s,i&&n.jsx(cn,{size:40,options:i.options,value:i.value,placeholder:i.placeholder,onChange:i.onChange,ariaLabel:typeof e=="string"&&e?h("common.sortFor",{name:e}):void 0}),u]})]}),!r&&(c?n.jsx("div",{className:"training-card-group__empty body-3",children:d}):n.jsx("div",{className:"training-card-group__grid",children:x}))]})}const ow="speechear:saved_word_tables";function sw(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.name=="string"&&Array.isArray(t.items)}function lw(){try{const e=localStorage.getItem(ow);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(sw):[]}catch{return[]}}function dd(e){return{label:e.word,subLabel:e.pronunciation,colloquialLabel:e.colloquialPronunciation,homonum:e.homonum,grade:e.grade,syllables:[...e.word].length,pos:e.pos,wordType:e.wordType}}function Ds(e){return e.map(t=>t.homonum!=null?`${t.word}#${t.homonum}`:t.word).join("|")}function iw(e){const t=new Set;return e.map(a=>{let r=a.id;for(let l=2;t.has(r);l++)r=`${a.id}~${l}`;return t.add(r),r===a.id?a:{...a,id:r}})}function uw({title:e,titleIcon:t,disc:a,filterTitle:r,filterCollapsible:l,filterDefaultCollapsed:s,filterCollapsed:i,onFilterCollapsedChange:u,filterHeaderSummary:c,brand:d,code:m,items:p,onSaveComplete:f,onLoad:b,onRemoveItem:x,onReset:C,resetLabel:h,saveButtonLabel:_,secondarySaveButtonLabel:g,onReorder:A,showCellCount:y,onAddItem:w,className:v,renderSavePopup:B,renderWordSearch:k,hideControls:E,saveOnly:D,tableName:N,nameValue:I,onNameChange:P,descriptionValue:K,onDescriptionChange:T,namePlaceholder:M,descriptionPlaceholder:L,existingNames:Q,editingName:H,onCancel:O,initialItemsPerPage:U,renderCellAction:$,actionsLeftExtra:V}){const{t:z}=xe.useTranslation(),Y=h??z("wordPrint.clearAllSelection","\uBAA8\uB450 \uC120\uD0DD \uD574\uC81C"),S=p===void 0,R=!!P,[F,Z]=o.useState([]),pe=(I??"").trim(),re=pe||(M??"").trim(),oe=(K??"").trim()||(L??"").trim(),ne=(Q??[]).map(ee=>ee.trim().toLowerCase()),W=[H?.trim().toLowerCase(),...F].filter(ee=>!!ee),ie=[...ne];for(const ee of W){const ve=ie.indexOf(ee);ve!==-1&&ie.splice(ve,1)}const q=pe!==""&&ie.includes(pe.toLowerCase()),[G,de]=o.useState(Array(4).fill(null)),[Ee,ye]=o.useState(4),[me,se]=o.useState(null),Ce=G.slice(0,Ee),ge=!!d?.show,[ce,Me]=o.useState(!0),[Oe,Le]=o.useState(!0),ze=d&&{...d,top:ce,bottom:Oe},[We,dt]=o.useState("landscape"),[lt,at]=o.useState(["image","word","standardPron"]),[mt,Ae]=o.useState("show"),[qe,we]=o.useState(!0),[Ue,ke]=o.useState(!0),$e=o.useRef(null),je=o.useRef([]),[Ze,yt]=o.useState(U==="all"?Number.POSITIVE_INFINITY:U??8),[et,Xe]=o.useState("right"),[_t,Ct]=o.useState(!1),[wt,Bt]=o.useState(!1),{toastMessage:ht,toastType:rt,showWarning:te,clearToast:Ne}=Oi("warning"),Je=o.useCallback(()=>se(null),[se]);w&&!S&&!y&&St("word-table-block-add-without-cell-count",'[WordTableBlock] \uD45C\uC2DC \uBAA8\uB4DC\uC5D0\uC11C onAddItem \uC740 showCellCount \uC640 \uD568\uAED8 \uC918\uC57C "\uCD94\uAC00\uD558\uAE30" \uCE78\uC774 \uC0DD\uAE34\uB2E4.');const[Ve,it]=o.useState(()=>Math.max(p?.length??1,1)),Se=S?Ee:y?Math.max(Ve,p?.length??1,1):Math.max(p?.length??0,1),{width:pt,height:gt}=ga[We],Pe=!S&&!y,nt=p?.length??0,vt=Math.min(Ze,Math.max(nt,1)),Ge=Pe?vt:Se,ot=Pe?Zu(p??[],Ge):null,st=!!ot&&ot.length>1,ct=S?Ce.some(ee=>ee!==null&&ee.length>1):(p??[]).some(ee=>(ee.words??[]).length>1),kt=N?.trim()||`${Hl(La())} ${ct?z("wordTable.printFileNamePair","\uB300\uB9BD\uC30D\uD45C"):z("wordTable.printFileNameSingle","\uB2E8\uC5B4\uD45C")}`,Vt=o.useCallback(()=>st?je.current.filter(ee=>ee!==null):$e.current?[$e.current]:[],[st]),{print:en,openNewWindow:Cn,downloadHtml:jn}=ls({getElements:Vt,paperW:pt,paperH:gt,fileName:kt,onPopupBlocked:()=>{te(z("wordTable.popupBlocked","\uD31D\uC5C5\uC774 \uCC28\uB2E8\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uBE0C\uB77C\uC6B0\uC800 \uC124\uC815\uC5D0\uC11C \uD31D\uC5C5\uC744 \uD5C8\uC6A9\uD574 \uC8FC\uC138\uC694."))}}),Wn=ee=>{ye(ee),de(ve=>ve.length>=ee?ve:[...ve,...Array(ee-ve.length).fill(null)]),se(null)},Hn=ee=>{de(ve=>{const Re=[...ve];return Re[ee]=null,Re}),me===ee&&se(null)},qt=ee=>{if(me===null)return;const ve=me;de(He=>{const tt=[...He];return tt[ve]=ee.length>0?ee:null,tt});const Re=Ce.findIndex((He,tt)=>tt>ve&&He===null);se(Re!==-1?Re:null)},dn=S?Ce.some(ee=>ee?.some(ve=>!!ve.colloquialPronunciation)):(p??[]).some(ee=>(ee.words??[]).some(ve=>!!ve.colloquialLabel)),Ut=o.useMemo(()=>sa()?S?G.slice(0,Ee).flatMap(ee=>(ee??[]).map(ve=>[ve.word,ve.homonum])):(p??[]).flatMap(ee=>(ee.words??[]).map(ve=>[ve.label,ve.homonum])):[],[S,G,Ee,p]),[Lt,Tn]=o.useState(!1);o.useEffect(()=>{if(Ut.length===0)return;let ee=!1;return Promise.all(Ut.map(([ve,Re])=>Nl(ve,Re))).then(ve=>{ee||Tn(ve.some(Boolean))},()=>{}),()=>{ee=!0}},[Ut]);const ln=Ut.length>0&&Lt,Mn=o.useMemo(()=>[...S||y?[{label:z("wordTable.filter.columns","\uCE78 \uC218"),items:A4.map(ee=>({value:`${ee}\uCE78`,displayLabel:z("wordTable.filter.column",{count:ee})})),display:"segmented"}]:[],...Pe&&(p?.length??0)>0?[mc(z,{hasPairs:ct,itemCount:nt})]:[],...st?[N4(z)]:[]],[z,S,y,Pe,p?.length,ct,nt,st]),Ln={...S||y?{[z("wordTable.filter.columns","\uCE78 \uC218")]:`${Se}\uCE78`}:{},...Pe&&(p?.length??0)>0?{[z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")]:`${vt}\uAC1C`}:{},...st?{[z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")]:et}:{}},xn=(ee,ve)=>{ve===z("wordTable.filter.columns","\uCE78 \uC218")?S?Wn(parseInt(ee)):it(parseInt(ee)):ve===z(ct?"wordTable.filter.itemsPerPagePair":"wordTable.filter.itemsPerPageWord")?yt(hc(parseInt(ee),nt)):ve===z("wordTable.filter.pageNumber","\uD398\uC774\uC9C0 \uBC88\uD638")&&Xe(fc(ee))},Gt=S?iw(Ce.filter(ee=>ee!==null&&ee.length>0).map(ee=>({id:Ds(ee),words:ee.map(dd)}))):p??[],Ft=()=>{S&&de(ee=>ee.length>Ee?ee.slice(0,Ee):ee)},$t=(ee=!1)=>{if(Bt(ee),R&&f){const ve=re.trim().toLowerCase();ve&&Z(Re=>Re.includes(ve)?Re:[...Re,ve]),f(re,Gt,oe||void 0,ee),Ft();return}if(D&&f){f("",Gt,void 0,ee),Ft();return}if(f){Ct(!0);return}jn()},[pn,Ot]=o.useState(!1),[tn,Tt]=o.useState(""),Kt=tn.trim(),le=Kt!==""&&ne.includes(Kt.toLowerCase()),Be=()=>{Tt(re?z("wordTable.save.copyName",{name:re,defaultValue:"{{name}} (\uBCF5\uC0AC)"}):""),Ot(!0)},Te=()=>{!Kt||le||!f||(f(Kt,Gt,oe||void 0,!0),Ft(),Ot(!1))},Ke=Gt.length===0,Fe=Ke||R&&(re===""||q),X=()=>{if(Ke){te(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."));return}if(R&&re===""){te(z("wordTable.save.nameRequired","\uD45C \uC774\uB984\uC744 \uC785\uB825\uD574 \uC8FC\uC138\uC694."));return}R&&q&&te(z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."))},ue=n.jsx(ba,{items:Gt,orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Se});return n.jsxs(n.Fragment,{children:[n.jsxs(Ca,{type:"page",icon:t,title:e,disc:a,className:_e("word-table-block",v),children:[pn&&n.jsx(On,{size:"small",title:g??z("wordTable.saveAsNewButton","\uB2E4\uB978 \uC774\uB984\uC73C\uB85C \uC800\uC7A5"),onClose:()=>Ot(!1),footer:({closeWithAnimation:ee})=>n.jsxs(n.Fragment,{children:[n.jsx(fe,{htmlType:"button",size:48,type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:ee}),n.jsx(fe,{htmlType:"button",size:48,type:"bar",variant:"main",label:z("common.save","\uC800\uC7A5"),disabled:!Kt||le,onClick:Te})]}),children:n.jsx(Xn,{label:z("wordTable.save.nameLabel","\uC774\uB984"),value:tn,onChange:Tt,placeholder:z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),maxLength:40,size:48,fullWidth:!0,autoFocus:!0,onEnter:Te,error:le?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0})}),_t&&f&&B?.({defaultName:typeof e=="string"?e:z("wordTable.defaultName","\uB2E8\uC5B4 \uD45C"),preview:ue,previewW:pt,previewH:gt,items:Gt,existingNames:lw().map(ee=>ee.name),saveAsNew:wt,onSave:(ee,ve)=>{f(ee,Gt,ve,wt),Ft(),Ct(!1)},onCancel:()=>Ct(!1)}),(S||w)&&me!==null&&k?.({cellIndex:me,onConfirm:S?qt:ee=>{if(w){const ve=ee[0];if(ve){const Re=new Set((p??[]).map(tt=>tt.id));let He=Ds([ve]);for(let tt=2;Re.has(He);tt++)He=`${Ds([ve])}~${tt}`;w({id:He,words:[dd(ve)]})}}se(null)},onClose:Je}),!E&&n.jsx(as,{title:r,collapsible:l,defaultCollapsed:s,collapsed:i,onCollapsedChange:u,headerSummary:c,hasImage:ln,hasColloquial:dn,contentTypes:lt,orientation:We,showOutline:qe,cutLine:mt,showDivLine:Ue,setters:{setContentTypes:at,setOrientation:dt,setShowOutline:we,setCutLine:Ae,setShowDivLine:ke,setShowTopInfo:Me,setShowBottomInfo:Le},showCutLine:(Pe?Ge:Se)>1,showDivLine2:ct,middleSections:Mn,extraSelected:Ln,onExtraSelect:xn,showPaperBands:ge,showTopInfo:ce,showBottomInfo:Oe}),st&&ot?n.jsx("div",{className:"word-table-block__pages",children:ot.map((ee,ve)=>n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Ge,items:ee,onRemoveItem:x,onReorder:A&&((Re,He)=>A(Re+ve*Ge,He+ve*Ge)),renderCellAction:$&&((Re,He)=>$(Re+ve*Ge,He)),brand:ze,code:m,contentRef:Re=>{je.current[ve]=Re},pageNumber:{current:ve+1,total:ot.length},pageNumberPosition:et},ve))}):n.jsx(ba,{orientation:We,contentTypes:lt,cutLine:mt,showOutline:qe,showDivLine:Ue,count:Se,items:S?void 0:p??[],editCells:S?Ce:void 0,activeCell:me,onActivateCell:S||w?se:void 0,onRemoveCell:S?Hn:void 0,onRemoveItem:S?void 0:x,onReorder:S?void 0:A,renderCellAction:S?void 0:$,brand:ze,code:m,showFillerAdd:!!w,contentRef:$e}),!E&&!D&&V!=null&&n.jsx("div",{className:"word-table-block__table-actions",children:V}),R&&!E&&n.jsxs(Ar,{size:"medium",labelWidth:64,useBorder:!1,useRowBorder:!1,className:"word-table-block__meta",children:[n.jsx(Dn,{variant:"custom",label:z("wordTable.save.nameLabel","\uC774\uB984"),required:!0,align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{required:!0,value:I??"",onChange:P,placeholder:M?M+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.placeholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.nameLabel","\uC774\uB984"),maxLength:40,size:48,fullWidth:!0,error:q?z("wordTable.save.duplicateName","\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uC774\uB984\uC785\uB2C8\uB2E4."):void 0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(I??"").trim()&&(M??"").trim()&&(ee.preventDefault(),P?.(M??""))}})}),n.jsx(Dn,{variant:"custom",label:z("wordTable.save.descriptionLabel","\uC124\uBA85"),align:"vertical",useFullWidth:!0,children:n.jsx(Xn,{value:K??"",onChange:T,placeholder:L?L+z("wordTable.save.autoFillHint"," (Tab \uB610\uB294 space \uC785\uB825\uC2DC \uC790\uB3D9 \uC785\uB825)"):z("wordTable.save.descriptionPlaceholder","\uC774 \uB2E8\uC5B4\uD45C\uC5D0 \uB300\uD55C \uC124\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694."),ariaLabel:z("wordTable.save.descriptionLabel","\uC124\uBA85"),maxLength:200,multiline:!0,rows:2,fullWidth:!0,onKeyDown:ee=>{(ee.key==="Tab"&&!ee.shiftKey||ee.key===" ")&&!(K??"").trim()&&(L??"").trim()&&(ee.preventDefault(),T?.(L??""))}})})]})]}),!E&&n.jsxs("div",{className:"word-table-block__actions",children:[n.jsxs("div",{className:"word-table-block__actions-left",children:[!D&&b&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.load","\uBD88\uB7EC\uC624\uAE30"),onClick:b}),!D&&C&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:Y,onClick:C}),!D&&n.jsx(fe,{htmlType:"button",size:40,type:"bar",label:z("wordTable.openNewWindow","\uC0C8 \uCC3D\uC73C\uB85C \uBCF4\uAE30"),onClick:Cn})]}),n.jsxs("div",{className:"word-table-block__actions-right",children:[O&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("common.cancel","\uCDE8\uC18C"),onClick:O}),!D&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:z("wordTable.print","\uC778\uC1C4\uD558\uAE30"),onClick:en}),g&&n.jsx(fe,{htmlType:"button",size:"56",type:"bar",label:g,onClick:()=>R?Be():$t(!0),disabled:Ke,onDisabledClick:()=>{te(z("wordTable.emptyItems","\uB2E8\uC5B4\uB97C 1\uAC1C \uC774\uC0C1 \uCD94\uAC00\uD574\uC8FC\uC138\uC694."))}}),n.jsx(fe,{htmlType:"button",size:"56",type:"bar",variant:"main",label:_??z("wordTable.saveButton","\uC800\uC7A5\uD558\uAE30"),onClick:()=>$t(!1),disabled:Fe,onDisabledClick:X})]})]}),n.jsx(ha,{message:ht,type:rt,onClose:Ne})]})}function pd({items:e,className:t}){const a=e.length,r=a<=3?1:2,l=Math.ceil(a/r)||1,s=r*l;return n.jsx("div",{className:_e("word-table-thumb",t),style:{gridTemplateColumns:`repeat(${r}, 1fr)`},children:Array.from({length:s},(i,u)=>{const c=e[u];return c?n.jsx("div",{className:"word-table-thumb__cell",children:(c.words?.length?c.words:[{label:c.id}]).map((d,m)=>n.jsxs(o.Fragment,{children:[m>0&&n.jsx("span",{className:"word-table-thumb__divider"}),n.jsx("span",{className:"word-table-thumb__word body-3",children:d.label})]},m))},u):n.jsx("div",{className:"word-table-thumb__cell word-table-thumb__cell--empty"},u)})})}function cw({items:e,name:t,description:a,createdAt:r,code:l,published:s,publishedLabel:i,shared:u,sharedLabel:c,isNew:d,publisherName:m,publishedAt:p,likeCount:f,downloadCount:b,onPublisherClick:x,selected:C,onClick:h,onMore:_,titleNode:g,className:A}){const{t:y}=xe.useTranslation(),w=g!=null,v=m!=null||p!=null||f!=null||b!=null,B=k=>{k.target===k.currentTarget&&!w&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h?.())};return n.jsxs("div",{className:_e("word-table-button",C?"word-table-button--selected":"",v?"":"word-table-button--no-footer",A),role:"button",tabIndex:0,"aria-label":l?`${t} (${l})`:t,onClick:w?void 0:h,onKeyDown:B,children:[d&&n.jsx("span",{className:"word-table-button__new-dot","aria-label":y("myWordTable.newBadge","\uC0C8\uB85C \uB9CC\uB4E0 \uD45C")}),n.jsx(pd,{items:e,className:"word-table-button__thumb"}),n.jsxs("div",{className:"word-table-button__info",children:[n.jsxs("div",{className:"word-table-button__info-text",children:[g??n.jsx("div",{className:"word-table-button__title h4",children:t}),a&&n.jsx("div",{className:"word-table-button__desc body-3",children:a})]}),_&&!w&&n.jsx(fe,{htmlType:"button",className:"word-table-button__more",size:32,type:"dot",variant:"transparent-gray",useBorder:!1,icon:"ellipsis",ariaLabel:y("common.moreFor",{name:t}),onClick:k=>{k.stopPropagation(),_(k)}})]}),(l||r||s||u)&&n.jsxs("div",{className:"word-table-button__meta-row",children:[n.jsx("span",{className:"word-table-button__meta-left",children:n.jsx("span",{className:"word-table-button__meta caption-1",children:r?Wl(r,y):""})}),n.jsxs("span",{className:"word-table-button__meta-right",children:[(s||u)&&n.jsxs("span",{className:"word-table-button__badges",children:[s&&n.jsx(Et,{className:"word-table-button__badge",size:"small",variant:"main",fill:"soft",iconLeft:"book-marked",label:i??y("myWordTable.publishedBadge","\uBC1C\uD589\uB428")}),u&&n.jsx(Et,{className:"word-table-button__badge",size:"small",fill:"soft",iconLeft:"link",label:c??y("myWordTable.sharedBadge","\uACF5\uC720 \uC911")})]}),l&&n.jsx("span",{className:"word-table-button__code caption-1",children:l})]})]}),v&&n.jsxs("div",{className:"word-table-button__footer",children:[n.jsxs("span",{className:"word-table-button__store-by",children:[m&&(x?n.jsx("button",{className:"training-card__publisher body-4",type:"button","aria-label":y("wordTable.publisherFilter",{name:m,defaultValue:"{{name}} \uAC8C\uC2DC\uD55C \uAC83\uB9CC \uBCF4\uAE30"}),onClick:k=>{k.stopPropagation(),x()},children:m}):n.jsx("span",{className:"training-card__publisher training-card__publisher--static body-4",children:m})),p&&n.jsx("span",{className:"training-card__date body-4",children:Wl(p,y)})]}),n.jsxs("span",{className:"word-table-button__store-stats",children:[f!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"like",iconLeft:"heart",label:String(f),"aria-label":y("common.likeCount",{count:f,defaultValue:`\uC88B\uC544\uC694 ${f}`})}),b!=null&&n.jsx(Et,{size:"small",fill:"soft",variant:"main",iconLeft:"download",label:String(b),"aria-label":y("common.downloadCount",{count:b,defaultValue:`\uAC00\uC838\uAC04 \uC218 ${b}`})})]})]})]})}/**
1041
1041
  * @license lucide-react v1.38.0 - ISC
1042
1042
  *
1043
1043
  * This source code is licensed under the ISC license.