@anoki/fse-ui 1.0.0-beta1.42 → 1.0.0-beta1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs135.js +1 -1
- package/dist/index.cjs135.js.map +1 -1
- package/dist/index.cjs221.js +1 -1
- package/dist/index.cjs223.js +1 -1
- package/dist/index.cjs237.js +1 -1
- package/dist/index.cjs241.js +1 -1
- package/dist/index.cjs248.js +1 -1
- package/dist/index.cjs254.js +1 -1
- package/dist/index.cjs255.js +1 -1
- package/dist/index.cjs256.js +1 -1
- package/dist/index.cjs257.js +1 -1
- package/dist/index.cjs285.js +1 -1
- package/dist/index.cjs290.js +1 -1
- package/dist/index.cjs298.js +1 -1
- package/dist/index.cjs308.js +1 -1
- package/dist/index.cjs315.js +1 -1
- package/dist/index.cjs346.js +1 -1
- package/dist/index.cjs364.js +1 -1
- package/dist/index.cjs365.js +1 -1
- package/dist/index.cjs387.js +1 -1
- package/dist/index.cjs393.js +1 -1
- package/dist/index.cjs405.js +1 -1
- package/dist/index.cjs436.js +1 -1
- package/dist/index.cjs442.js +2 -0
- package/dist/index.cjs442.js.map +1 -0
- package/dist/index.cjs443.js +1 -1
- package/dist/index.cjs443.js.map +1 -1
- package/dist/index.cjs444.js +1 -1
- package/dist/index.cjs444.js.map +1 -1
- package/dist/index.cjs445.js +9 -1
- package/dist/index.cjs445.js.map +1 -1
- package/dist/index.cjs446.js +17 -3
- package/dist/index.cjs446.js.map +1 -1
- package/dist/index.cjs447.js +1 -23
- package/dist/index.cjs447.js.map +1 -1
- package/dist/index.cjs448.js +2 -27
- package/dist/index.cjs448.js.map +1 -1
- package/dist/index.cjs449.js +27 -1
- package/dist/index.cjs449.js.map +1 -1
- package/dist/index.cjs450.js +1 -1
- package/dist/index.cjs451.js +1 -1
- package/dist/index.cjs451.js.map +1 -1
- package/dist/index.cjs452.js +1 -2
- package/dist/index.cjs452.js.map +1 -1
- package/dist/index.cjs453.js +1 -1
- package/dist/index.cjs453.js.map +1 -1
- package/dist/index.cjs454.js +1 -1
- package/dist/index.cjs454.js.map +1 -1
- package/dist/index.cjs456.js +2 -0
- package/dist/index.cjs456.js.map +1 -0
- package/dist/index.cjs457.js +1 -1
- package/dist/index.cjs457.js.map +1 -1
- package/dist/index.cjs458.js +1 -1
- package/dist/index.cjs458.js.map +1 -1
- package/dist/index.cjs459.js +1 -1
- package/dist/index.cjs459.js.map +1 -1
- package/dist/index.cjs460.js +1 -1
- package/dist/index.cjs460.js.map +1 -1
- package/dist/index.cjs461.js +1 -1
- package/dist/index.cjs461.js.map +1 -1
- package/dist/index.cjs462.js +1 -1
- package/dist/index.cjs462.js.map +1 -1
- package/dist/index.cjs463.js +1 -1
- package/dist/index.cjs463.js.map +1 -1
- package/dist/index.cjs466.js +2 -0
- package/dist/index.cjs466.js.map +1 -0
- package/dist/index.cjs467.js +1 -1
- package/dist/index.cjs467.js.map +1 -1
- package/dist/index.cjs468.js +1 -1
- package/dist/index.cjs468.js.map +1 -1
- package/dist/index.cjs469.js +1 -1
- package/dist/index.cjs469.js.map +1 -1
- package/dist/index.cjs471.js +1 -1
- package/dist/index.cjs471.js.map +1 -1
- package/dist/{index.cjs487.js → index.cjs472.js} +2 -2
- package/dist/{index.cjs487.js.map → index.cjs472.js.map} +1 -1
- package/dist/{index.cjs486.js → index.cjs473.js} +2 -2
- package/dist/{index.cjs486.js.map → index.cjs473.js.map} +1 -1
- package/dist/{index.cjs488.js → index.cjs474.js} +1 -1
- package/dist/{index.cjs488.js.map → index.cjs474.js.map} +1 -1
- package/dist/index.cjs475.js +1 -1
- package/dist/index.cjs475.js.map +1 -1
- package/dist/index.cjs479.js +1 -1
- package/dist/index.cjs479.js.map +1 -1
- package/dist/index.cjs480.js +1 -1
- package/dist/index.cjs480.js.map +1 -1
- package/dist/index.cjs481.js +1 -1
- package/dist/index.cjs481.js.map +1 -1
- package/dist/{index.cjs478.js → index.cjs482.js} +1 -1
- package/dist/{index.cjs478.js.map → index.cjs482.js.map} +1 -1
- package/dist/index.cjs483.js +2 -0
- package/dist/index.cjs483.js.map +1 -0
- package/dist/index.cjs484.js +2 -0
- package/dist/index.cjs484.js.map +1 -0
- package/dist/index.cjs485.js +1 -1
- package/dist/index.cjs485.js.map +1 -1
- package/dist/index.cjs492.js +1 -1
- package/dist/index.cjs494.js +1 -1
- package/dist/index.cjs495.js +1 -1
- package/dist/index.cjs5.js +1 -1
- package/dist/index.cjs509.js +1 -1
- package/dist/index.cjs510.js +1 -1
- package/dist/index.cjs515.js +1 -1
- package/dist/index.cjs516.js +1 -1
- package/dist/index.cjs517.js +1 -1
- package/dist/index.cjs519.js +1 -1
- package/dist/index.cjs519.js.map +1 -1
- package/dist/index.cjs520.js +1 -1
- package/dist/index.cjs520.js.map +1 -1
- package/dist/index.cjs521.js +1 -1
- package/dist/index.cjs521.js.map +1 -1
- package/dist/index.cjs522.js +1 -1
- package/dist/index.cjs522.js.map +1 -1
- package/dist/index.cjs523.js +1 -1
- package/dist/index.cjs523.js.map +1 -1
- package/dist/index.cjs524.js +1 -1
- package/dist/index.cjs524.js.map +1 -1
- package/dist/index.cjs525.js +1 -1
- package/dist/index.cjs525.js.map +1 -1
- package/dist/index.cjs526.js +1 -1
- package/dist/index.cjs526.js.map +1 -1
- package/dist/index.cjs527.js +1 -1
- package/dist/index.cjs527.js.map +1 -1
- package/dist/index.cjs528.js +1 -1
- package/dist/index.cjs528.js.map +1 -1
- package/dist/index.cjs529.js +1 -1
- package/dist/index.cjs529.js.map +1 -1
- package/dist/index.cjs530.js +1 -1
- package/dist/index.cjs530.js.map +1 -1
- package/dist/index.cjs531.js +1 -1
- package/dist/index.cjs531.js.map +1 -1
- package/dist/index.cjs532.js +1 -1
- package/dist/index.cjs532.js.map +1 -1
- package/dist/index.cjs533.js +1 -1
- package/dist/index.cjs533.js.map +1 -1
- package/dist/index.cjs534.js +1 -1
- package/dist/index.cjs534.js.map +1 -1
- package/dist/index.cjs535.js +1 -1
- package/dist/index.cjs535.js.map +1 -1
- package/dist/index.cjs536.js +1 -1
- package/dist/index.cjs536.js.map +1 -1
- package/dist/index.cjs537.js +1 -1
- package/dist/index.cjs537.js.map +1 -1
- package/dist/index.cjs538.js +1 -1
- package/dist/index.cjs538.js.map +1 -1
- package/dist/index.cjs539.js +1 -1
- package/dist/index.cjs539.js.map +1 -1
- package/dist/index.cjs540.js +1 -1
- package/dist/index.cjs540.js.map +1 -1
- package/dist/index.cjs541.js +1 -1
- package/dist/index.cjs541.js.map +1 -1
- package/dist/index.cjs542.js +1 -1
- package/dist/index.cjs542.js.map +1 -1
- package/dist/index.cjs543.js +1 -1
- package/dist/index.cjs543.js.map +1 -1
- package/dist/index.cjs544.js +1 -1
- package/dist/index.cjs544.js.map +1 -1
- package/dist/index.cjs545.js +1 -1
- package/dist/index.cjs545.js.map +1 -1
- package/dist/index.cjs546.js +1 -38
- package/dist/index.cjs546.js.map +1 -1
- package/dist/index.cjs547.js +1 -1
- package/dist/index.cjs547.js.map +1 -1
- package/dist/index.cjs548.js +1 -1
- package/dist/index.cjs548.js.map +1 -1
- package/dist/index.cjs549.js +38 -1
- package/dist/index.cjs549.js.map +1 -1
- package/dist/index.cjs550.js +1 -1
- package/dist/index.cjs550.js.map +1 -1
- package/dist/index.cjs551.js +1 -1
- package/dist/index.cjs551.js.map +1 -1
- package/dist/index.cjs552.js +1 -1
- package/dist/index.cjs552.js.map +1 -1
- package/dist/index.cjs559.js +1 -1
- package/dist/{index.cjs572.js → index.cjs566.js} +1 -1
- package/dist/{index.cjs572.js.map → index.cjs566.js.map} +1 -1
- package/dist/{index.cjs573.js → index.cjs567.js} +1 -1
- package/dist/{index.cjs573.js.map → index.cjs567.js.map} +1 -1
- package/dist/index.cjs568.js +2 -0
- package/dist/index.cjs568.js.map +1 -0
- package/dist/{index.cjs576.js → index.cjs569.js} +1 -1
- package/dist/{index.cjs576.js.map → index.cjs569.js.map} +1 -1
- package/dist/index.cjs570.js +1 -1
- package/dist/index.cjs570.js.map +1 -1
- package/dist/index.cjs574.js +2 -0
- package/dist/index.cjs574.js.map +1 -0
- package/dist/index.cjs575.js +1 -1
- package/dist/index.cjs575.js.map +1 -1
- package/dist/{index.cjs584.js → index.cjs580.js} +2 -2
- package/dist/{index.cjs584.js.map → index.cjs580.js.map} +1 -1
- package/dist/{index.cjs585.js → index.cjs581.js} +2 -2
- package/dist/{index.cjs585.js.map → index.cjs581.js.map} +1 -1
- package/dist/index.cjs582.js +1 -1
- package/dist/index.cjs582.js.map +1 -1
- package/dist/index.cjs586.js +1 -1
- package/dist/index.cjs586.js.map +1 -1
- package/dist/index.cjs588.js +1 -1
- package/dist/index.es135.js +62 -78
- package/dist/index.es135.js.map +1 -1
- package/dist/index.es221.js +1 -1
- package/dist/index.es223.js +1 -1
- package/dist/index.es237.js +1 -1
- package/dist/index.es241.js +1 -1
- package/dist/index.es248.js +2 -2
- package/dist/index.es254.js +3 -3
- package/dist/index.es255.js +2 -2
- package/dist/index.es256.js +3 -3
- package/dist/index.es257.js +3 -3
- package/dist/index.es285.js +7 -7
- package/dist/index.es290.js +1 -1
- package/dist/index.es298.js +8 -8
- package/dist/index.es308.js +1 -1
- package/dist/index.es315.js +14 -14
- package/dist/index.es346.js +7 -7
- package/dist/index.es364.js +6 -6
- package/dist/index.es365.js +2 -2
- package/dist/index.es387.js +4 -4
- package/dist/index.es393.js +1 -1
- package/dist/index.es405.js +8 -8
- package/dist/index.es436.js +1 -1
- package/dist/index.es442.js +139 -0
- package/dist/index.es442.js.map +1 -0
- package/dist/index.es443.js +7 -135
- package/dist/index.es443.js.map +1 -1
- package/dist/index.es444.js +2 -8
- package/dist/index.es444.js.map +1 -1
- package/dist/index.es445.js +33 -2
- package/dist/index.es445.js.map +1 -1
- package/dist/index.es446.js +396 -23
- package/dist/index.es446.js.map +1 -1
- package/dist/index.es447.js +5 -405
- package/dist/index.es447.js.map +1 -1
- package/dist/index.es448.js +499 -3653
- package/dist/index.es448.js.map +1 -1
- package/dist/index.es449.js +3674 -5
- package/dist/index.es449.js.map +1 -1
- package/dist/index.es450.js +6 -2
- package/dist/index.es450.js.map +1 -1
- package/dist/index.es451.js +2 -6
- package/dist/index.es451.js.map +1 -1
- package/dist/index.es452.js +1999 -494
- package/dist/index.es452.js.map +1 -1
- package/dist/index.es453.js +52 -2018
- package/dist/index.es453.js.map +1 -1
- package/dist/index.es454.js +187 -57
- package/dist/index.es454.js.map +1 -1
- package/dist/index.es456.js +10 -0
- package/dist/index.es456.js.map +1 -0
- package/dist/index.es457.js +25 -5
- package/dist/index.es457.js.map +1 -1
- package/dist/index.es458.js +64 -23
- package/dist/index.es458.js.map +1 -1
- package/dist/index.es459.js +27 -65
- package/dist/index.es459.js.map +1 -1
- package/dist/index.es460.js +32 -29
- package/dist/index.es460.js.map +1 -1
- package/dist/index.es461.js +620 -31
- package/dist/index.es461.js.map +1 -1
- package/dist/index.es462.js +10 -621
- package/dist/index.es462.js.map +1 -1
- package/dist/index.es463.js +15 -11
- package/dist/index.es463.js.map +1 -1
- package/dist/index.es466.js +9 -0
- package/dist/index.es466.js.map +1 -0
- package/dist/index.es467.js +24 -5
- package/dist/index.es467.js.map +1 -1
- package/dist/index.es468.js +67 -23
- package/dist/index.es468.js.map +1 -1
- package/dist/index.es469.js +2 -69
- package/dist/index.es469.js.map +1 -1
- package/dist/index.es470.js +2 -2
- package/dist/index.es471.js +15 -2
- package/dist/index.es471.js.map +1 -1
- package/dist/{index.es487.js → index.es472.js} +2 -2
- package/dist/{index.es487.js.map → index.es472.js.map} +1 -1
- package/dist/{index.es486.js → index.es473.js} +2 -2
- package/dist/{index.es486.js.map → index.es473.js.map} +1 -1
- package/dist/{index.es488.js → index.es474.js} +1 -1
- package/dist/{index.es488.js.map → index.es474.js.map} +1 -1
- package/dist/index.es475.js +128 -120
- package/dist/index.es475.js.map +1 -1
- package/dist/index.es479.js +124 -8
- package/dist/index.es479.js.map +1 -1
- package/dist/index.es480.js +133 -48
- package/dist/index.es480.js.map +1 -1
- package/dist/index.es481.js +14 -56
- package/dist/index.es481.js.map +1 -1
- package/dist/{index.es478.js → index.es482.js} +1 -1
- package/dist/{index.es478.js.map → index.es482.js.map} +1 -1
- package/dist/index.es483.js +12 -0
- package/dist/index.es483.js.map +1 -0
- package/dist/index.es484.js +53 -0
- package/dist/index.es484.js.map +1 -0
- package/dist/index.es485.js +50 -127
- package/dist/index.es485.js.map +1 -1
- package/dist/index.es492.js +3 -3
- package/dist/index.es494.js +4 -4
- package/dist/index.es495.js +6 -6
- package/dist/index.es5.js +1 -1
- package/dist/index.es509.js +1 -1
- package/dist/index.es510.js +3 -3
- package/dist/index.es515.js +1 -1
- package/dist/index.es516.js +2 -2
- package/dist/index.es517.js +4 -4
- package/dist/index.es519.js +523 -5
- package/dist/index.es519.js.map +1 -1
- package/dist/index.es520.js +127 -16
- package/dist/index.es520.js.map +1 -1
- package/dist/index.es521.js +129 -13
- package/dist/index.es521.js.map +1 -1
- package/dist/index.es522.js +5 -36
- package/dist/index.es522.js.map +1 -1
- package/dist/index.es523.js +16 -5
- package/dist/index.es523.js.map +1 -1
- package/dist/index.es524.js +13 -2
- package/dist/index.es524.js.map +1 -1
- package/dist/index.es525.js +36 -3
- package/dist/index.es525.js.map +1 -1
- package/dist/index.es526.js +5 -7
- package/dist/index.es526.js.map +1 -1
- package/dist/index.es527.js +2 -6
- package/dist/index.es527.js.map +1 -1
- package/dist/index.es528.js +3 -5
- package/dist/index.es528.js.map +1 -1
- package/dist/index.es529.js +7 -32
- package/dist/index.es529.js.map +1 -1
- package/dist/index.es530.js +5 -241
- package/dist/index.es530.js.map +1 -1
- package/dist/index.es531.js +5 -4
- package/dist/index.es531.js.map +1 -1
- package/dist/index.es532.js +32 -5
- package/dist/index.es532.js.map +1 -1
- package/dist/index.es533.js +241 -9
- package/dist/index.es533.js.map +1 -1
- package/dist/index.es534.js +4 -56
- package/dist/index.es534.js.map +1 -1
- package/dist/index.es535.js +4 -7
- package/dist/index.es535.js.map +1 -1
- package/dist/index.es536.js +9 -5
- package/dist/index.es536.js.map +1 -1
- package/dist/index.es537.js +47 -524
- package/dist/index.es537.js.map +1 -1
- package/dist/index.es538.js +8 -14
- package/dist/index.es538.js.map +1 -1
- package/dist/index.es539.js +6 -2
- package/dist/index.es539.js.map +1 -1
- package/dist/index.es540.js +531 -35
- package/dist/index.es540.js.map +1 -1
- package/dist/index.es541.js +14 -2
- package/dist/index.es541.js.map +1 -1
- package/dist/index.es542.js +2 -273
- package/dist/index.es542.js.map +1 -1
- package/dist/index.es543.js +37 -3
- package/dist/index.es543.js.map +1 -1
- package/dist/index.es544.js +2 -30
- package/dist/index.es544.js.map +1 -1
- package/dist/index.es545.js +266 -58
- package/dist/index.es545.js.map +1 -1
- package/dist/index.es546.js +3 -69
- package/dist/index.es546.js.map +1 -1
- package/dist/index.es547.js +30 -9
- package/dist/index.es547.js.map +1 -1
- package/dist/index.es548.js +64 -13
- package/dist/index.es548.js.map +1 -1
- package/dist/index.es549.js +68 -61
- package/dist/index.es549.js.map +1 -1
- package/dist/index.es550.js +7 -521
- package/dist/index.es550.js.map +1 -1
- package/dist/index.es551.js +13 -126
- package/dist/index.es551.js.map +1 -1
- package/dist/index.es552.js +60 -127
- package/dist/index.es552.js.map +1 -1
- package/dist/index.es559.js +2 -2
- package/dist/{index.es572.js → index.es566.js} +1 -1
- package/dist/{index.es572.js.map → index.es566.js.map} +1 -1
- package/dist/{index.es573.js → index.es567.js} +1 -1
- package/dist/{index.es573.js.map → index.es567.js.map} +1 -1
- package/dist/index.es568.js +7 -0
- package/dist/index.es568.js.map +1 -0
- package/dist/{index.es576.js → index.es569.js} +1 -1
- package/dist/{index.es576.js.map → index.es569.js.map} +1 -1
- package/dist/index.es570.js +2 -74
- package/dist/index.es570.js.map +1 -1
- package/dist/index.es574.js +77 -0
- package/dist/index.es574.js.map +1 -0
- package/dist/index.es575.js +2 -4
- package/dist/index.es575.js.map +1 -1
- package/dist/{index.es584.js → index.es580.js} +2 -2
- package/dist/{index.es584.js.map → index.es580.js.map} +1 -1
- package/dist/{index.es585.js → index.es581.js} +2 -2
- package/dist/{index.es585.js.map → index.es581.js.map} +1 -1
- package/dist/index.es582.js +5 -5
- package/dist/index.es582.js.map +1 -1
- package/dist/index.es586.js +5 -5
- package/dist/index.es586.js.map +1 -1
- package/dist/index.es588.js +1 -1
- package/package.json +2 -1
- package/dist/index.cjs441.js +0 -2
- package/dist/index.cjs441.js.map +0 -1
- package/dist/index.cjs455.js +0 -2
- package/dist/index.cjs455.js.map +0 -1
- package/dist/index.cjs464.js +0 -2
- package/dist/index.cjs464.js.map +0 -1
- package/dist/index.cjs476.js +0 -2
- package/dist/index.cjs476.js.map +0 -1
- package/dist/index.cjs477.js +0 -2
- package/dist/index.cjs477.js.map +0 -1
- package/dist/index.cjs571.js +0 -2
- package/dist/index.cjs571.js.map +0 -1
- package/dist/index.cjs577.js +0 -2
- package/dist/index.cjs577.js.map +0 -1
- package/dist/index.es441.js +0 -25
- package/dist/index.es441.js.map +0 -1
- package/dist/index.es455.js +0 -193
- package/dist/index.es455.js.map +0 -1
- package/dist/index.es464.js +0 -18
- package/dist/index.es464.js.map +0 -1
- package/dist/index.es476.js +0 -138
- package/dist/index.es476.js.map +0 -1
- package/dist/index.es477.js +0 -17
- package/dist/index.es477.js.map +0 -1
- package/dist/index.es571.js +0 -5
- package/dist/index.es571.js.map +0 -1
- package/dist/index.es577.js +0 -5
- package/dist/index.es577.js.map +0 -1
package/dist/index.es441.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es441.js","sources":["../node_modules/usehooks-ts/dist/index.js"],"sourcesContent":["import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n"],"names":["useCopyToClipboard","copiedText","setCopiedText","useState","copy","useCallback","text","error","useToggle","defaultValue","value","setValue","toggle","x"],"mappings":";;AAgDA,SAASA,IAAqB;AAC5B,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,IAAI,GAC3CC,IAAOC,EAAY,OAAOC,MAAS;AACvC,QAAI,EAAE,aAAa,QAAgB,UAAU;AAC3C,qBAAQ,KAAK,yBAAyB,GAC/B;AAET,QAAI;AACF,mBAAM,UAAU,UAAU,UAAUA,CAAI,GACxCJ,EAAcI,CAAI,GACX;AAAA,IACR,SAAQC,GAAO;AACd,qBAAQ,KAAK,eAAeA,CAAK,GACjCL,EAAc,IAAI,GACX;AAAA,IACb;AAAA,EACG,GAAE,EAAE;AACL,SAAO,CAACD,GAAYG,CAAI;AAC1B;AAw6BA,SAASI,EAAUC,GAAc;AAC/B,QAAM,CAACC,GAAOC,CAAQ,IAAIR,EAAS,EAAc,GAC3CS,IAASP,EAAY,MAAM;AAC/B,IAAAM,EAAS,CAACE,MAAM,CAACA,CAAC;AAAA,EACnB,GAAE,EAAE;AACL,SAAO,CAACH,GAAOE,GAAQD,CAAQ;AACjC;","x_google_ignoreList":[0]}
|
package/dist/index.es455.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { s as z } from "./index.es486.js";
|
|
2
|
-
const B = [
|
|
3
|
-
"eventsPrefix",
|
|
4
|
-
"injectStyles",
|
|
5
|
-
"injectStylesUrls",
|
|
6
|
-
"modules",
|
|
7
|
-
"init",
|
|
8
|
-
"_direction",
|
|
9
|
-
"oneWayMovement",
|
|
10
|
-
"swiperElementNodeName",
|
|
11
|
-
"touchEventsTarget",
|
|
12
|
-
"initialSlide",
|
|
13
|
-
"_speed",
|
|
14
|
-
"cssMode",
|
|
15
|
-
"updateOnWindowResize",
|
|
16
|
-
"resizeObserver",
|
|
17
|
-
"nested",
|
|
18
|
-
"focusableElements",
|
|
19
|
-
"_enabled",
|
|
20
|
-
"_width",
|
|
21
|
-
"_height",
|
|
22
|
-
"preventInteractionOnTransition",
|
|
23
|
-
"userAgent",
|
|
24
|
-
"url",
|
|
25
|
-
"_edgeSwipeDetection",
|
|
26
|
-
"_edgeSwipeThreshold",
|
|
27
|
-
"_freeMode",
|
|
28
|
-
"_autoHeight",
|
|
29
|
-
"setWrapperSize",
|
|
30
|
-
"virtualTranslate",
|
|
31
|
-
"_effect",
|
|
32
|
-
"breakpoints",
|
|
33
|
-
"breakpointsBase",
|
|
34
|
-
"_spaceBetween",
|
|
35
|
-
"_slidesPerView",
|
|
36
|
-
"maxBackfaceHiddenSlides",
|
|
37
|
-
"_grid",
|
|
38
|
-
"_slidesPerGroup",
|
|
39
|
-
"_slidesPerGroupSkip",
|
|
40
|
-
"_slidesPerGroupAuto",
|
|
41
|
-
"_centeredSlides",
|
|
42
|
-
"_centeredSlidesBounds",
|
|
43
|
-
"_slidesOffsetBefore",
|
|
44
|
-
"_slidesOffsetAfter",
|
|
45
|
-
"normalizeSlideIndex",
|
|
46
|
-
"_centerInsufficientSlides",
|
|
47
|
-
"_watchOverflow",
|
|
48
|
-
"roundLengths",
|
|
49
|
-
"touchRatio",
|
|
50
|
-
"touchAngle",
|
|
51
|
-
"simulateTouch",
|
|
52
|
-
"_shortSwipes",
|
|
53
|
-
"_longSwipes",
|
|
54
|
-
"longSwipesRatio",
|
|
55
|
-
"longSwipesMs",
|
|
56
|
-
"_followFinger",
|
|
57
|
-
"allowTouchMove",
|
|
58
|
-
"_threshold",
|
|
59
|
-
"touchMoveStopPropagation",
|
|
60
|
-
"touchStartPreventDefault",
|
|
61
|
-
"touchStartForcePreventDefault",
|
|
62
|
-
"touchReleaseOnEdges",
|
|
63
|
-
"uniqueNavElements",
|
|
64
|
-
"_resistance",
|
|
65
|
-
"_resistanceRatio",
|
|
66
|
-
"_watchSlidesProgress",
|
|
67
|
-
"_grabCursor",
|
|
68
|
-
"preventClicks",
|
|
69
|
-
"preventClicksPropagation",
|
|
70
|
-
"_slideToClickedSlide",
|
|
71
|
-
"_loop",
|
|
72
|
-
"loopAdditionalSlides",
|
|
73
|
-
"loopAddBlankSlides",
|
|
74
|
-
"loopPreventsSliding",
|
|
75
|
-
"_rewind",
|
|
76
|
-
"_allowSlidePrev",
|
|
77
|
-
"_allowSlideNext",
|
|
78
|
-
"_swipeHandler",
|
|
79
|
-
"_noSwiping",
|
|
80
|
-
"noSwipingClass",
|
|
81
|
-
"noSwipingSelector",
|
|
82
|
-
"passiveListeners",
|
|
83
|
-
"containerModifierClass",
|
|
84
|
-
"slideClass",
|
|
85
|
-
"slideActiveClass",
|
|
86
|
-
"slideVisibleClass",
|
|
87
|
-
"slideFullyVisibleClass",
|
|
88
|
-
"slideNextClass",
|
|
89
|
-
"slidePrevClass",
|
|
90
|
-
"slideBlankClass",
|
|
91
|
-
"wrapperClass",
|
|
92
|
-
"lazyPreloaderClass",
|
|
93
|
-
"lazyPreloadPrevNext",
|
|
94
|
-
"runCallbacksOnInit",
|
|
95
|
-
"observer",
|
|
96
|
-
"observeParents",
|
|
97
|
-
"observeSlideChildren",
|
|
98
|
-
// modules
|
|
99
|
-
"a11y",
|
|
100
|
-
"_autoplay",
|
|
101
|
-
"_controller",
|
|
102
|
-
"coverflowEffect",
|
|
103
|
-
"cubeEffect",
|
|
104
|
-
"fadeEffect",
|
|
105
|
-
"flipEffect",
|
|
106
|
-
"creativeEffect",
|
|
107
|
-
"cardsEffect",
|
|
108
|
-
"hashNavigation",
|
|
109
|
-
"history",
|
|
110
|
-
"keyboard",
|
|
111
|
-
"mousewheel",
|
|
112
|
-
"_navigation",
|
|
113
|
-
"_pagination",
|
|
114
|
-
"parallax",
|
|
115
|
-
"_scrollbar",
|
|
116
|
-
"_thumbs",
|
|
117
|
-
"virtual",
|
|
118
|
-
"zoom",
|
|
119
|
-
"control"
|
|
120
|
-
];
|
|
121
|
-
function b(t) {
|
|
122
|
-
return typeof t == "object" && t !== null && t.constructor && Object.prototype.toString.call(t).slice(8, -1) === "Object" && !t.__swiper__;
|
|
123
|
-
}
|
|
124
|
-
function I(t, i) {
|
|
125
|
-
const r = ["__proto__", "constructor", "prototype"];
|
|
126
|
-
Object.keys(i).filter((e) => r.indexOf(e) < 0).forEach((e) => {
|
|
127
|
-
typeof t[e] > "u" ? t[e] = i[e] : b(i[e]) && b(t[e]) && Object.keys(i[e]).length > 0 ? i[e].__swiper__ ? t[e] = i[e] : I(t[e], i[e]) : t[e] = i[e];
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
function M(t) {
|
|
131
|
-
return t === void 0 && (t = {}), t.navigation && typeof t.navigation.nextEl > "u" && typeof t.navigation.prevEl > "u";
|
|
132
|
-
}
|
|
133
|
-
function L(t) {
|
|
134
|
-
return t === void 0 && (t = {}), t.pagination && typeof t.pagination.el > "u";
|
|
135
|
-
}
|
|
136
|
-
function N(t) {
|
|
137
|
-
return t === void 0 && (t = {}), t.scrollbar && typeof t.scrollbar.el > "u";
|
|
138
|
-
}
|
|
139
|
-
function A(t) {
|
|
140
|
-
t === void 0 && (t = "");
|
|
141
|
-
const i = t.split(" ").map((e) => e.trim()).filter((e) => !!e), r = [];
|
|
142
|
-
return i.forEach((e) => {
|
|
143
|
-
r.indexOf(e) < 0 && r.push(e);
|
|
144
|
-
}), r.join(" ");
|
|
145
|
-
}
|
|
146
|
-
function D(t) {
|
|
147
|
-
return t === void 0 && (t = ""), t ? t.includes("swiper-wrapper") ? t : `swiper-wrapper ${t}` : "swiper-wrapper";
|
|
148
|
-
}
|
|
149
|
-
function R(t) {
|
|
150
|
-
let {
|
|
151
|
-
swiper: i,
|
|
152
|
-
slides: r,
|
|
153
|
-
passedParams: e,
|
|
154
|
-
changedParams: o,
|
|
155
|
-
nextEl: s,
|
|
156
|
-
prevEl: a,
|
|
157
|
-
scrollbarEl: d,
|
|
158
|
-
paginationEl: c
|
|
159
|
-
} = t;
|
|
160
|
-
const h = o.filter((n) => n !== "children" && n !== "direction" && n !== "wrapperClass"), {
|
|
161
|
-
params: l,
|
|
162
|
-
pagination: p,
|
|
163
|
-
navigation: f,
|
|
164
|
-
scrollbar: v,
|
|
165
|
-
virtual: u,
|
|
166
|
-
thumbs: E
|
|
167
|
-
} = i;
|
|
168
|
-
let S, _, x, C, P, m, O, g;
|
|
169
|
-
o.includes("thumbs") && e.thumbs && e.thumbs.swiper && !e.thumbs.swiper.destroyed && l.thumbs && (!l.thumbs.swiper || l.thumbs.swiper.destroyed) && (S = !0), o.includes("controller") && e.controller && e.controller.control && l.controller && !l.controller.control && (_ = !0), o.includes("pagination") && e.pagination && (e.pagination.el || c) && (l.pagination || l.pagination === !1) && p && !p.el && (x = !0), o.includes("scrollbar") && e.scrollbar && (e.scrollbar.el || d) && (l.scrollbar || l.scrollbar === !1) && v && !v.el && (C = !0), o.includes("navigation") && e.navigation && (e.navigation.prevEl || a) && (e.navigation.nextEl || s) && (l.navigation || l.navigation === !1) && f && !f.prevEl && !f.nextEl && (P = !0);
|
|
170
|
-
const j = (n) => {
|
|
171
|
-
i[n] && (i[n].destroy(), n === "navigation" ? (i.isElement && (i[n].prevEl.remove(), i[n].nextEl.remove()), l[n].prevEl = void 0, l[n].nextEl = void 0, i[n].prevEl = void 0, i[n].nextEl = void 0) : (i.isElement && i[n].el.remove(), l[n].el = void 0, i[n].el = void 0));
|
|
172
|
-
};
|
|
173
|
-
o.includes("loop") && i.isElement && (l.loop && !e.loop ? m = !0 : !l.loop && e.loop ? O = !0 : g = !0), h.forEach((n) => {
|
|
174
|
-
if (b(l[n]) && b(e[n]))
|
|
175
|
-
Object.assign(l[n], e[n]), (n === "navigation" || n === "pagination" || n === "scrollbar") && "enabled" in e[n] && !e[n].enabled && j(n);
|
|
176
|
-
else {
|
|
177
|
-
const w = e[n];
|
|
178
|
-
(w === !0 || w === !1) && (n === "navigation" || n === "pagination" || n === "scrollbar") ? w === !1 && j(n) : l[n] = e[n];
|
|
179
|
-
}
|
|
180
|
-
}), h.includes("controller") && !_ && i.controller && i.controller.control && l.controller && l.controller.control && (i.controller.control = l.controller.control), o.includes("children") && r && u && l.virtual.enabled ? (u.slides = r, u.update(!0)) : o.includes("virtual") && u && l.virtual.enabled && (r && (u.slides = r), u.update(!0)), o.includes("children") && r && l.loop && (g = !0), S && E.init() && E.update(!0), _ && (i.controller.control = l.controller.control), x && (i.isElement && (!c || typeof c == "string") && (c = document.createElement("div"), c.classList.add("swiper-pagination"), c.part.add("pagination"), i.el.appendChild(c)), c && (l.pagination.el = c), p.init(), p.render(), p.update()), C && (i.isElement && (!d || typeof d == "string") && (d = document.createElement("div"), d.classList.add("swiper-scrollbar"), d.part.add("scrollbar"), i.el.appendChild(d)), d && (l.scrollbar.el = d), v.init(), v.updateSize(), v.setTranslate()), P && (i.isElement && ((!s || typeof s == "string") && (s = document.createElement("div"), s.classList.add("swiper-button-next"), z(s, i.hostEl.constructor.nextButtonSvg), s.part.add("button-next"), i.el.appendChild(s)), (!a || typeof a == "string") && (a = document.createElement("div"), a.classList.add("swiper-button-prev"), z(a, i.hostEl.constructor.prevButtonSvg), a.part.add("button-prev"), i.el.appendChild(a))), s && (l.navigation.nextEl = s), a && (l.navigation.prevEl = a), f.init(), f.update()), o.includes("allowSlideNext") && (i.allowSlideNext = e.allowSlideNext), o.includes("allowSlidePrev") && (i.allowSlidePrev = e.allowSlidePrev), o.includes("direction") && i.changeDirection(e.direction, !1), (m || g) && i.loopDestroy(), (O || g) && i.loopCreate(), i.update();
|
|
181
|
-
}
|
|
182
|
-
export {
|
|
183
|
-
L as a,
|
|
184
|
-
N as b,
|
|
185
|
-
A as d,
|
|
186
|
-
I as e,
|
|
187
|
-
b as i,
|
|
188
|
-
M as n,
|
|
189
|
-
B as p,
|
|
190
|
-
R as u,
|
|
191
|
-
D as w
|
|
192
|
-
};
|
|
193
|
-
//# sourceMappingURL=index.es455.js.map
|
package/dist/index.es455.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es455.js","sources":["../node_modules/swiper/shared/update-swiper.mjs"],"sourcesContent":["import { s as setInnerHTML } from './utils.mjs';\n\n/* underscore in name -> watch for changes */\nconst paramsList = ['eventsPrefix', 'injectStyles', 'injectStylesUrls', 'modules', 'init', '_direction', 'oneWayMovement', 'swiperElementNodeName', 'touchEventsTarget', 'initialSlide', '_speed', 'cssMode', 'updateOnWindowResize', 'resizeObserver', 'nested', 'focusableElements', '_enabled', '_width', '_height', 'preventInteractionOnTransition', 'userAgent', 'url', '_edgeSwipeDetection', '_edgeSwipeThreshold', '_freeMode', '_autoHeight', 'setWrapperSize', 'virtualTranslate', '_effect', 'breakpoints', 'breakpointsBase', '_spaceBetween', '_slidesPerView', 'maxBackfaceHiddenSlides', '_grid', '_slidesPerGroup', '_slidesPerGroupSkip', '_slidesPerGroupAuto', '_centeredSlides', '_centeredSlidesBounds', '_slidesOffsetBefore', '_slidesOffsetAfter', 'normalizeSlideIndex', '_centerInsufficientSlides', '_watchOverflow', 'roundLengths', 'touchRatio', 'touchAngle', 'simulateTouch', '_shortSwipes', '_longSwipes', 'longSwipesRatio', 'longSwipesMs', '_followFinger', 'allowTouchMove', '_threshold', 'touchMoveStopPropagation', 'touchStartPreventDefault', 'touchStartForcePreventDefault', 'touchReleaseOnEdges', 'uniqueNavElements', '_resistance', '_resistanceRatio', '_watchSlidesProgress', '_grabCursor', 'preventClicks', 'preventClicksPropagation', '_slideToClickedSlide', '_loop', 'loopAdditionalSlides', 'loopAddBlankSlides', 'loopPreventsSliding', '_rewind', '_allowSlidePrev', '_allowSlideNext', '_swipeHandler', '_noSwiping', 'noSwipingClass', 'noSwipingSelector', 'passiveListeners', 'containerModifierClass', 'slideClass', 'slideActiveClass', 'slideVisibleClass', 'slideFullyVisibleClass', 'slideNextClass', 'slidePrevClass', 'slideBlankClass', 'wrapperClass', 'lazyPreloaderClass', 'lazyPreloadPrevNext', 'runCallbacksOnInit', 'observer', 'observeParents', 'observeSlideChildren',\n// modules\n'a11y', '_autoplay', '_controller', 'coverflowEffect', 'cubeEffect', 'fadeEffect', 'flipEffect', 'creativeEffect', 'cardsEffect', 'hashNavigation', 'history', 'keyboard', 'mousewheel', '_navigation', '_pagination', 'parallax', '_scrollbar', '_thumbs', 'virtual', 'zoom', 'control'];\n\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object' && !o.__swiper__;\n}\nfunction extend(target, src) {\n const noExtend = ['__proto__', 'constructor', 'prototype'];\n Object.keys(src).filter(key => noExtend.indexOf(key) < 0).forEach(key => {\n if (typeof target[key] === 'undefined') target[key] = src[key];else if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {\n if (src[key].__swiper__) target[key] = src[key];else extend(target[key], src[key]);\n } else {\n target[key] = src[key];\n }\n });\n}\nfunction needsNavigation(params) {\n if (params === void 0) {\n params = {};\n }\n return params.navigation && typeof params.navigation.nextEl === 'undefined' && typeof params.navigation.prevEl === 'undefined';\n}\nfunction needsPagination(params) {\n if (params === void 0) {\n params = {};\n }\n return params.pagination && typeof params.pagination.el === 'undefined';\n}\nfunction needsScrollbar(params) {\n if (params === void 0) {\n params = {};\n }\n return params.scrollbar && typeof params.scrollbar.el === 'undefined';\n}\nfunction uniqueClasses(classNames) {\n if (classNames === void 0) {\n classNames = '';\n }\n const classes = classNames.split(' ').map(c => c.trim()).filter(c => !!c);\n const unique = [];\n classes.forEach(c => {\n if (unique.indexOf(c) < 0) unique.push(c);\n });\n return unique.join(' ');\n}\nfunction attrToProp(attrName) {\n if (attrName === void 0) {\n attrName = '';\n }\n return attrName.replace(/-[a-z]/g, l => l.toUpperCase().replace('-', ''));\n}\nfunction wrapperClass(className) {\n if (className === void 0) {\n className = '';\n }\n if (!className) return 'swiper-wrapper';\n if (!className.includes('swiper-wrapper')) return `swiper-wrapper ${className}`;\n return className;\n}\n\nfunction updateSwiper(_ref) {\n let {\n swiper,\n slides,\n passedParams,\n changedParams,\n nextEl,\n prevEl,\n scrollbarEl,\n paginationEl\n } = _ref;\n const updateParams = changedParams.filter(key => key !== 'children' && key !== 'direction' && key !== 'wrapperClass');\n const {\n params: currentParams,\n pagination,\n navigation,\n scrollbar,\n virtual,\n thumbs\n } = swiper;\n let needThumbsInit;\n let needControllerInit;\n let needPaginationInit;\n let needScrollbarInit;\n let needNavigationInit;\n let loopNeedDestroy;\n let loopNeedEnable;\n let loopNeedReloop;\n if (changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && !passedParams.thumbs.swiper.destroyed && currentParams.thumbs && (!currentParams.thumbs.swiper || currentParams.thumbs.swiper.destroyed)) {\n needThumbsInit = true;\n }\n if (changedParams.includes('controller') && passedParams.controller && passedParams.controller.control && currentParams.controller && !currentParams.controller.control) {\n needControllerInit = true;\n }\n if (changedParams.includes('pagination') && passedParams.pagination && (passedParams.pagination.el || paginationEl) && (currentParams.pagination || currentParams.pagination === false) && pagination && !pagination.el) {\n needPaginationInit = true;\n }\n if (changedParams.includes('scrollbar') && passedParams.scrollbar && (passedParams.scrollbar.el || scrollbarEl) && (currentParams.scrollbar || currentParams.scrollbar === false) && scrollbar && !scrollbar.el) {\n needScrollbarInit = true;\n }\n if (changedParams.includes('navigation') && passedParams.navigation && (passedParams.navigation.prevEl || prevEl) && (passedParams.navigation.nextEl || nextEl) && (currentParams.navigation || currentParams.navigation === false) && navigation && !navigation.prevEl && !navigation.nextEl) {\n needNavigationInit = true;\n }\n const destroyModule = mod => {\n if (!swiper[mod]) return;\n swiper[mod].destroy();\n if (mod === 'navigation') {\n if (swiper.isElement) {\n swiper[mod].prevEl.remove();\n swiper[mod].nextEl.remove();\n }\n currentParams[mod].prevEl = undefined;\n currentParams[mod].nextEl = undefined;\n swiper[mod].prevEl = undefined;\n swiper[mod].nextEl = undefined;\n } else {\n if (swiper.isElement) {\n swiper[mod].el.remove();\n }\n currentParams[mod].el = undefined;\n swiper[mod].el = undefined;\n }\n };\n if (changedParams.includes('loop') && swiper.isElement) {\n if (currentParams.loop && !passedParams.loop) {\n loopNeedDestroy = true;\n } else if (!currentParams.loop && passedParams.loop) {\n loopNeedEnable = true;\n } else {\n loopNeedReloop = true;\n }\n }\n updateParams.forEach(key => {\n if (isObject(currentParams[key]) && isObject(passedParams[key])) {\n Object.assign(currentParams[key], passedParams[key]);\n if ((key === 'navigation' || key === 'pagination' || key === 'scrollbar') && 'enabled' in passedParams[key] && !passedParams[key].enabled) {\n destroyModule(key);\n }\n } else {\n const newValue = passedParams[key];\n if ((newValue === true || newValue === false) && (key === 'navigation' || key === 'pagination' || key === 'scrollbar')) {\n if (newValue === false) {\n destroyModule(key);\n }\n } else {\n currentParams[key] = passedParams[key];\n }\n }\n });\n if (updateParams.includes('controller') && !needControllerInit && swiper.controller && swiper.controller.control && currentParams.controller && currentParams.controller.control) {\n swiper.controller.control = currentParams.controller.control;\n }\n if (changedParams.includes('children') && slides && virtual && currentParams.virtual.enabled) {\n virtual.slides = slides;\n virtual.update(true);\n } else if (changedParams.includes('virtual') && virtual && currentParams.virtual.enabled) {\n if (slides) virtual.slides = slides;\n virtual.update(true);\n }\n if (changedParams.includes('children') && slides && currentParams.loop) {\n loopNeedReloop = true;\n }\n if (needThumbsInit) {\n const initialized = thumbs.init();\n if (initialized) thumbs.update(true);\n }\n if (needControllerInit) {\n swiper.controller.control = currentParams.controller.control;\n }\n if (needPaginationInit) {\n if (swiper.isElement && (!paginationEl || typeof paginationEl === 'string')) {\n paginationEl = document.createElement('div');\n paginationEl.classList.add('swiper-pagination');\n paginationEl.part.add('pagination');\n swiper.el.appendChild(paginationEl);\n }\n if (paginationEl) currentParams.pagination.el = paginationEl;\n pagination.init();\n pagination.render();\n pagination.update();\n }\n if (needScrollbarInit) {\n if (swiper.isElement && (!scrollbarEl || typeof scrollbarEl === 'string')) {\n scrollbarEl = document.createElement('div');\n scrollbarEl.classList.add('swiper-scrollbar');\n scrollbarEl.part.add('scrollbar');\n swiper.el.appendChild(scrollbarEl);\n }\n if (scrollbarEl) currentParams.scrollbar.el = scrollbarEl;\n scrollbar.init();\n scrollbar.updateSize();\n scrollbar.setTranslate();\n }\n if (needNavigationInit) {\n if (swiper.isElement) {\n if (!nextEl || typeof nextEl === 'string') {\n nextEl = document.createElement('div');\n nextEl.classList.add('swiper-button-next');\n setInnerHTML(nextEl, swiper.hostEl.constructor.nextButtonSvg);\n nextEl.part.add('button-next');\n swiper.el.appendChild(nextEl);\n }\n if (!prevEl || typeof prevEl === 'string') {\n prevEl = document.createElement('div');\n prevEl.classList.add('swiper-button-prev');\n setInnerHTML(prevEl, swiper.hostEl.constructor.prevButtonSvg);\n prevEl.part.add('button-prev');\n swiper.el.appendChild(prevEl);\n }\n }\n if (nextEl) currentParams.navigation.nextEl = nextEl;\n if (prevEl) currentParams.navigation.prevEl = prevEl;\n navigation.init();\n navigation.update();\n }\n if (changedParams.includes('allowSlideNext')) {\n swiper.allowSlideNext = passedParams.allowSlideNext;\n }\n if (changedParams.includes('allowSlidePrev')) {\n swiper.allowSlidePrev = passedParams.allowSlidePrev;\n }\n if (changedParams.includes('direction')) {\n swiper.changeDirection(passedParams.direction, false);\n }\n if (loopNeedDestroy || loopNeedReloop) {\n swiper.loopDestroy();\n }\n if (loopNeedEnable || loopNeedReloop) {\n swiper.loopCreate();\n }\n swiper.update();\n}\n\nexport { needsPagination as a, needsScrollbar as b, attrToProp as c, uniqueClasses as d, extend as e, isObject as i, needsNavigation as n, paramsList as p, updateSwiper as u, wrapperClass as w };\n"],"names":["paramsList","isObject","o","extend","target","src","noExtend","key","needsNavigation","params","needsPagination","needsScrollbar","uniqueClasses","classNames","classes","c","unique","wrapperClass","className","updateSwiper","_ref","swiper","slides","passedParams","changedParams","nextEl","prevEl","scrollbarEl","paginationEl","updateParams","currentParams","pagination","navigation","scrollbar","virtual","thumbs","needThumbsInit","needControllerInit","needPaginationInit","needScrollbarInit","needNavigationInit","loopNeedDestroy","loopNeedEnable","loopNeedReloop","destroyModule","mod","newValue","setInnerHTML"],"mappings":";AAGK,MAACA,IAAa;AAAA,EAAC;AAAA,EAAgB;AAAA,EAAgB;AAAA,EAAoB;AAAA,EAAW;AAAA,EAAQ;AAAA,EAAc;AAAA,EAAkB;AAAA,EAAyB;AAAA,EAAqB;AAAA,EAAgB;AAAA,EAAU;AAAA,EAAW;AAAA,EAAwB;AAAA,EAAkB;AAAA,EAAU;AAAA,EAAqB;AAAA,EAAY;AAAA,EAAU;AAAA,EAAW;AAA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K,GAC1CA,EAAY,UAAU,IAAI,kBAAkB,GAC5CA,EAAY,KAAK,IAAI,WAAW,GAChCN,EAAO,GAAG,YAAYM,CAAW,IAE/BA,MAAaG,EAAc,UAAU,KAAKH,IAC9CM,EAAU,KAAM,GAChBA,EAAU,WAAY,GACtBA,EAAU,aAAc,IAEtBO,MACEnB,EAAO,eACL,CAACI,KAAU,OAAOA,KAAW,cAC/BA,IAAS,SAAS,cAAc,KAAK,GACrCA,EAAO,UAAU,IAAI,oBAAoB,GACzCsB,EAAatB,GAAQJ,EAAO,OAAO,YAAY,aAAa,GAC5DI,EAAO,KAAK,IAAI,aAAa,GAC7BJ,EAAO,GAAG,YAAYI,CAAM,KAE1B,CAACC,KAAU,OAAOA,KAAW,cAC/BA,IAAS,SAAS,cAAc,KAAK,GACrCA,EAAO,UAAU,IAAI,oBAAoB,GACzCqB,EAAarB,GAAQL,EAAO,OAAO,YAAY,aAAa,GAC5DK,EAAO,KAAK,IAAI,aAAa,GAC7BL,EAAO,GAAG,YAAYK,CAAM,KAG5BD,MAAQK,EAAc,WAAW,SAASL,IAC1CC,MAAQI,EAAc,WAAW,SAASJ,IAC9CM,EAAW,KAAM,GACjBA,EAAW,OAAQ,IAEjBR,EAAc,SAAS,gBAAgB,MACzCH,EAAO,iBAAiBE,EAAa,iBAEnCC,EAAc,SAAS,gBAAgB,MACzCH,EAAO,iBAAiBE,EAAa,iBAEnCC,EAAc,SAAS,WAAW,KACpCH,EAAO,gBAAgBE,EAAa,WAAW,EAAK,IAElDkB,KAAmBE,MACrBtB,EAAO,YAAa,IAElBqB,KAAkBC,MACpBtB,EAAO,WAAY,GAErBA,EAAO,OAAQ;AACjB;","x_google_ignoreList":[0]}
|
package/dist/index.es464.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useEffect as l } from "react";
|
|
2
|
-
const f = (t, n) => {
|
|
3
|
-
l(() => {
|
|
4
|
-
if (!n || !t.current) return;
|
|
5
|
-
const o = t.current.querySelectorAll(
|
|
6
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
7
|
-
), c = o[0], r = o[o.length - 1], s = (e) => {
|
|
8
|
-
e.key === "Tab" && (e.shiftKey ? document.activeElement === c && (r.focus(), e.preventDefault()) : document.activeElement === r && (c.focus(), e.preventDefault()));
|
|
9
|
-
}, u = document.activeElement;
|
|
10
|
-
return c.focus(), document.addEventListener("keydown", s), () => {
|
|
11
|
-
document.removeEventListener("keydown", s), n && (u == null || u.focus());
|
|
12
|
-
};
|
|
13
|
-
}, [n, t]);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
f as useFocusTrap
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=index.es464.js.map
|
package/dist/index.es464.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es464.js","sources":["../src/hooks/useFocusTrap.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nexport const useFocusTrap = (\n ref: React.RefObject<HTMLElement | null>,\n isActive: boolean,\n) => {\n useEffect(() => {\n if (!isActive || !ref.current) return;\n\n const focusableElements = ref.current.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])',\n );\n const firstFocusableElement = focusableElements[0] as HTMLElement;\n const lastFocusableElement = focusableElements[\n focusableElements.length - 1\n ] as HTMLElement;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n\n if (e.shiftKey) {\n if (document.activeElement === firstFocusableElement) {\n lastFocusableElement.focus();\n e.preventDefault();\n }\n } else {\n if (document.activeElement === lastFocusableElement) {\n firstFocusableElement.focus();\n e.preventDefault();\n }\n }\n };\n\n const previousActiveElement = document.activeElement as HTMLElement;\n\n firstFocusableElement.focus();\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n\n if (isActive) {\n previousActiveElement?.focus();\n }\n };\n }, [isActive, ref]);\n};\n"],"names":["useFocusTrap","ref","isActive","useEffect","focusableElements","firstFocusableElement","lastFocusableElement","handleKeyDown","previousActiveElement"],"mappings":";AAEa,MAAAA,IAAe,CAC1BC,GACAC,MACG;AACH,EAAAC,EAAU,MAAM;AACd,QAAI,CAACD,KAAY,CAACD,EAAI,QAAS;AAEzB,UAAAG,IAAoBH,EAAI,QAAQ;AAAA,MACpC;AAAA,IACF,GACMI,IAAwBD,EAAkB,CAAC,GAC3CE,IAAuBF,EAC3BA,EAAkB,SAAS,CAC7B,GAEMG,IAAgB,CAAC,MAAqB;AACtC,MAAA,EAAE,QAAQ,UAEV,EAAE,WACA,SAAS,kBAAkBF,MAC7BC,EAAqB,MAAM,GAC3B,EAAE,eAAe,KAGf,SAAS,kBAAkBA,MAC7BD,EAAsB,MAAM,GAC5B,EAAE,eAAe;AAAA,IAGvB,GAEMG,IAAwB,SAAS;AAEvC,WAAAH,EAAsB,MAAM,GAEnB,SAAA,iBAAiB,WAAWE,CAAa,GAE3C,MAAM;AACF,eAAA,oBAAoB,WAAWA,CAAa,GAEjDL,MACFM,KAAA,QAAAA,EAAuB;AAAA,IAE3B;AAAA,EAAA,GACC,CAACN,GAAUD,CAAG,CAAC;AACpB;"}
|
package/dist/index.es476.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import * as d from "react";
|
|
2
|
-
import { useComposedRefs as P } from "./index.es458.js";
|
|
3
|
-
import { Primitive as M } from "./index.es461.js";
|
|
4
|
-
import { useCallbackRef as y } from "./index.es491.js";
|
|
5
|
-
import { j as _ } from "./index.es237.js";
|
|
6
|
-
var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, n) => {
|
|
7
|
-
const {
|
|
8
|
-
loop: t = !1,
|
|
9
|
-
trapped: u = !1,
|
|
10
|
-
onMountAutoFocus: p,
|
|
11
|
-
onUnmountAutoFocus: L,
|
|
12
|
-
...g
|
|
13
|
-
} = e, [o, R] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), U = P(n, (s) => R(s)), a = d.useRef({
|
|
14
|
-
paused: !1,
|
|
15
|
-
pause() {
|
|
16
|
-
this.paused = !0;
|
|
17
|
-
},
|
|
18
|
-
resume() {
|
|
19
|
-
this.paused = !1;
|
|
20
|
-
}
|
|
21
|
-
}).current;
|
|
22
|
-
d.useEffect(() => {
|
|
23
|
-
if (u) {
|
|
24
|
-
let s = function(i) {
|
|
25
|
-
if (a.paused || !o) return;
|
|
26
|
-
const c = i.target;
|
|
27
|
-
o.contains(c) ? b.current = c : f(b.current, { select: !0 });
|
|
28
|
-
}, l = function(i) {
|
|
29
|
-
if (a.paused || !o) return;
|
|
30
|
-
const c = i.relatedTarget;
|
|
31
|
-
c !== null && (o.contains(c) || f(b.current, { select: !0 }));
|
|
32
|
-
}, r = function(i) {
|
|
33
|
-
if (document.activeElement === document.body)
|
|
34
|
-
for (const h of i)
|
|
35
|
-
h.removedNodes.length > 0 && f(o);
|
|
36
|
-
};
|
|
37
|
-
document.addEventListener("focusin", s), document.addEventListener("focusout", l);
|
|
38
|
-
const m = new MutationObserver(r);
|
|
39
|
-
return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
40
|
-
document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}, [u, o, a.paused]), d.useEffect(() => {
|
|
44
|
-
if (o) {
|
|
45
|
-
S.add(a);
|
|
46
|
-
const s = document.activeElement;
|
|
47
|
-
if (!o.contains(s)) {
|
|
48
|
-
const r = new CustomEvent(F, N);
|
|
49
|
-
o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(V(I(o)), { select: !0 }), document.activeElement === s && f(o));
|
|
50
|
-
}
|
|
51
|
-
return () => {
|
|
52
|
-
o.removeEventListener(F, E), setTimeout(() => {
|
|
53
|
-
const r = new CustomEvent(T, N);
|
|
54
|
-
o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), S.remove(a);
|
|
55
|
-
}, 0);
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}, [o, E, v, a]);
|
|
59
|
-
const A = d.useCallback(
|
|
60
|
-
(s) => {
|
|
61
|
-
if (!t && !u || a.paused) return;
|
|
62
|
-
const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
|
|
63
|
-
if (l && r) {
|
|
64
|
-
const m = s.currentTarget, [i, c] = x(m);
|
|
65
|
-
i && c ? !s.shiftKey && r === c ? (s.preventDefault(), t && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), t && f(c, { select: !0 })) : r === m && s.preventDefault();
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
[t, u, a.paused]
|
|
69
|
-
);
|
|
70
|
-
return /* @__PURE__ */ _.jsx(M.div, { tabIndex: -1, ...g, ref: U, onKeyDown: A });
|
|
71
|
-
});
|
|
72
|
-
k.displayName = K;
|
|
73
|
-
function w(e, { select: n = !1 } = {}) {
|
|
74
|
-
const t = document.activeElement;
|
|
75
|
-
for (const u of e)
|
|
76
|
-
if (f(u, { select: n }), document.activeElement !== t) return;
|
|
77
|
-
}
|
|
78
|
-
function x(e) {
|
|
79
|
-
const n = I(e), t = O(n, e), u = O(n.reverse(), e);
|
|
80
|
-
return [t, u];
|
|
81
|
-
}
|
|
82
|
-
function I(e) {
|
|
83
|
-
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
84
|
-
acceptNode: (u) => {
|
|
85
|
-
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
86
|
-
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
for (; t.nextNode(); ) n.push(t.currentNode);
|
|
90
|
-
return n;
|
|
91
|
-
}
|
|
92
|
-
function O(e, n) {
|
|
93
|
-
for (const t of e)
|
|
94
|
-
if (!D(t, { upTo: n })) return t;
|
|
95
|
-
}
|
|
96
|
-
function D(e, { upTo: n }) {
|
|
97
|
-
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
98
|
-
for (; e; ) {
|
|
99
|
-
if (n !== void 0 && e === n) return !1;
|
|
100
|
-
if (getComputedStyle(e).display === "none") return !0;
|
|
101
|
-
e = e.parentElement;
|
|
102
|
-
}
|
|
103
|
-
return !1;
|
|
104
|
-
}
|
|
105
|
-
function H(e) {
|
|
106
|
-
return e instanceof HTMLInputElement && "select" in e;
|
|
107
|
-
}
|
|
108
|
-
function f(e, { select: n = !1 } = {}) {
|
|
109
|
-
if (e && e.focus) {
|
|
110
|
-
const t = document.activeElement;
|
|
111
|
-
e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
var S = j();
|
|
115
|
-
function j() {
|
|
116
|
-
let e = [];
|
|
117
|
-
return {
|
|
118
|
-
add(n) {
|
|
119
|
-
const t = e[0];
|
|
120
|
-
n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
|
|
121
|
-
},
|
|
122
|
-
remove(n) {
|
|
123
|
-
var t;
|
|
124
|
-
e = C(e, n), (t = e[0]) == null || t.resume();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function C(e, n) {
|
|
129
|
-
const t = [...e], u = t.indexOf(n);
|
|
130
|
-
return u !== -1 && t.splice(u, 1), t;
|
|
131
|
-
}
|
|
132
|
-
function V(e) {
|
|
133
|
-
return e.filter((n) => n.tagName !== "A");
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
k as FocusScope
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=index.es476.js.map
|
package/dist/index.es476.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es476.js","sources":["../node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/focus-scope/src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FOCUS_SCOPE_NAME = \"FocusScope\";\nvar FocusScope = React.forwardRef((props, forwardedRef) => {\n const {\n loop = false,\n trapped = false,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (container.contains(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!container.contains(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n setTimeout(() => {\n const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? document.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n});\nFocusScope.displayName = FOCUS_SCOPE_NAME;\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n while (walker.nextNode()) nodes.push(walker.currentNode);\n return nodes;\n}\nfunction findVisible(elements, container) {\n for (const element of elements) {\n if (!isHidden(element, { upTo: container })) return element;\n }\n}\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\nfunction isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const previouslyFocusedElement = document.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\nvar Root = FocusScope;\nexport {\n FocusScope,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["AUTOFOCUS_ON_MOUNT","AUTOFOCUS_ON_UNMOUNT","EVENT_OPTIONS","FOCUS_SCOPE_NAME","FocusScope","React","props","forwardedRef","loop","trapped","onMountAutoFocusProp","onUnmountAutoFocusProp","scopeProps","container","setContainer","onMountAutoFocus","useCallbackRef","onUnmountAutoFocus","lastFocusedElementRef","composedRefs","useComposedRefs","node","focusScope","handleFocusIn2","event","target","focus","handleFocusOut2","relatedTarget","handleMutations2","mutations","mutation","mutationObserver","focusScopesStack","previouslyFocusedElement","mountEvent","focusFirst","removeLinks","getTabbableCandidates","unmountEvent","handleKeyDown","isTabKey","focusedElement","container2","first","last","getTabbableEdges","jsx","Primitive","candidates","select","candidate","findVisible","nodes","walker","isHiddenInput","elements","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","activeFocusScope","arrayRemove","_a","array","item","updatedArray","index","items"],"mappings":";;;;;AAQA,IAAIA,IAAqB,+BACrBC,IAAuB,iCACvBC,IAAgB,EAAE,SAAS,IAAO,YAAY,GAAM,GACpDC,IAAmB,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MAAIxC,MAAeyC,MACjBA,KAAA,QAAAA,EAAkB,UAEpBD,IAAQE,EAAYF,GAAOxC,CAAU,GACrCwC,EAAM,QAAQxC,CAAU;AAAA,IACzB;AAAA,IACD,OAAOA,GAAY;;AACjB,MAAAwC,IAAQE,EAAYF,GAAOxC,CAAU,IACrC2C,IAAAH,EAAM,CAAC,MAAP,QAAAG,EAAU;AAAA,IAChB;AAAA,EACG;AACH;AACA,SAASD,EAAYE,GAAOC,GAAM;AAChC,QAAMC,IAAe,CAAC,GAAGF,CAAK,GACxBG,IAAQD,EAAa,QAAQD,CAAI;AACvC,SAAIE,MAAU,MACZD,EAAa,OAAOC,GAAO,CAAC,GAEvBD;AACT;AACA,SAAS/B,EAAYiC,GAAO;AAC1B,SAAOA,EAAM,OAAO,CAACH,MAASA,EAAK,YAAY,GAAG;AACpD;","x_google_ignoreList":[0]}
|
package/dist/index.es477.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as r from "react";
|
|
2
|
-
import f from "react-dom";
|
|
3
|
-
import { Primitive as u } from "./index.es461.js";
|
|
4
|
-
import { useLayoutEffect as c } from "./index.es496.js";
|
|
5
|
-
import { j as l } from "./index.es237.js";
|
|
6
|
-
var p = "Portal", d = r.forwardRef((e, a) => {
|
|
7
|
-
var o;
|
|
8
|
-
const { container: s, ...i } = e, [m, n] = r.useState(!1);
|
|
9
|
-
c(() => n(!0), []);
|
|
10
|
-
const t = s || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
11
|
-
return t ? f.createPortal(/* @__PURE__ */ l.jsx(u.div, { ...i, ref: a }), t) : null;
|
|
12
|
-
});
|
|
13
|
-
d.displayName = p;
|
|
14
|
-
export {
|
|
15
|
-
d as Portal
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=index.es477.js.map
|
package/dist/index.es477.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es477.js","sources":["../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/portal/src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PORTAL_NAME","Portal","React","props","forwardedRef","containerProp","portalProps","mounted","setMounted","useLayoutEffect","container","_a","ReactDOM","jsx","Primitive"],"mappings":";;;;;AAQA,IAAIA,IAAc,UACdC,IAASC,EAAM,WAAW,CAACC,GAAOC,MAAiB;;AACrD,QAAM,EAAE,WAAWC,GAAe,GAAGC,EAAa,IAAGH,GAC/C,CAACI,GAASC,CAAU,IAAIN,EAAM,SAAS,EAAK;AAClDO,EAAAA,EAAgB,MAAMD,EAAW,EAAI,GAAG,CAAA,CAAE;AAC1C,QAAME,IAAYL,KAAiBE,OAAWI,IAAA,yCAAY,aAAZ,gBAAAA,EAAsB;AACpE,SAAOD,IAAYE,EAAS,aAA6BC,gBAAAA,EAAG,IAACC,EAAU,KAAK,EAAE,GAAGR,GAAa,KAAKF,EAAc,CAAA,GAAGM,CAAS,IAAI;AACnI,CAAC;AACDT,EAAO,cAAcD;","x_google_ignoreList":[0]}
|
package/dist/index.es571.js
DELETED
package/dist/index.es571.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es571.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es577.js
DELETED
package/dist/index.es577.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es577.js","sources":["../node_modules/@radix-ui/themes/dist/esm/props/high-contrast.prop.js"],"sourcesContent":["const o={highContrast:{type:\"boolean\",className:\"rt-high-contrast\",default:void 0}};export{o as highContrastPropDef};\n//# sourceMappingURL=high-contrast.prop.js.map\n"],"names":["o"],"mappings":"AAAK,MAACA,IAAE,EAAC,cAAa,EAAC,MAAK,WAAU,WAAU,oBAAmB,SAAQ,OAAM,EAAC;","x_google_ignoreList":[0]}
|