�����JFIF��XX����������    $.' ",#(7),01444'9=82<.342  2!!22222222222222222222222222222222222222222222222222�����"����4���������������������������� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������,�PG"Z_�4�˷����kjز�Z�,F+��_z�,�© �����zh6�٨�ic�fu������������������������������������#ډb���_�N��?�����������wQ���5-�~�I���8���������������������������������TK<5o�Iv-������������������k�_U_������������������������������~b�M��d��������Ӝ�U�Hh��?]��E�w��Q���k�{��_}qFW7HTՑ��Y��F�����?_�'ϔ��_�Ջt������������������������=||I �����6�έ"�����D���/[�k�9����Y�8������ds|\���Ҿp6�Ҵ���]��.����6���z<�v��@]�i%������������������������$j��~����g��J>��no����pM[me�i$[�����������s�o�ᘨ�˸ nɜG-�ĨU�ycP���3.DB�li�;���������������������hj���x����7Z^�N�h��������N3u{�:j�����x�힞��#M��&��jL P@��_���� P�������������������&��o8��������9������@Sz���6�t7#O�ߋ �����s}Yf�T������lmr����Z)'N��k�۞p�����w\�T���������������ȯ?�8`���O��i{wﭹW�[�r�� ��Q4F�׊������3m&L�=��h3�������z~��#����\�l :�F,j@�� ʱ�wQT����8�"kJO����6�֚l������������������}����R�>ډK���]��y����&����p�}b������;N�1�m�r$����|��7�>e�@���B�TM*-i�H��g�D�)� E�m�|�ؘbҗ�a���Ҿ����������������t4�����o���G��*oCN�rP���Q��@z,|?W[0���������:�n,j���WiE��W������$~/�hp\��?��{(�0���+�Y8rΟ�+����>S-S���������������VN;���}�s?.����� w��9��˟<���Mq4�Wv'������{)0�1mB����V����W[��������8�/<� �%���wT^�5���b��)iM� p�g�N�&ݝ������������VO~��q���u���9��� ����!��J27�����$����O-���! �:���%H��� ـ�������y�ΠM=t{!S�� �oK8�������t<����è��������:a��������[������ա�H���~��w��Qz`�p����o�^ ������Q��n����� �,uu�C��$ ^���,�������8�#��:�6��e�|~�����������!�3��3.�\0�����q��o�4`.|� ����y�Q�`~;�d�ׯ,��O�Zw�������`73�v�܋�<�����Ȏ�� ـ4k��5�K�a�u�=9Yd��$>x�A�&�� j0� ���vF��� Y���|�y��� ~�6�@c��1vOp��������Ig�����4��l�OD�����L����� R���c���j�_�uX�6��3?nk��Wy�f;^*B� ��@���~a�`��Eu�������+�����6�L��.ü>��}y���}_�O�6�͐�:�Yr���G�X��kG������l^w����������~㒶sy���Iu�!���� W ��X��N�7BV��O��!X�2����wvG�R�f�T#�����t�/?���%8�^�W�aT����G�cL�M���I��(J����1~�8�?aT ���]����AS�E��(��*E}� 2������#I/�׍qz��^t�̔���������b�Yz4x����t�){ OH�����+(E��A&�N�������XT��o��"�XC����'���)}�J�z�p� ����~5�}�^����+�6����w��c��Q�|�Lp�d�H��}�(�.|����k��c4^�����"�����Z?ȕ ��a<�������L�!0�39C� �Eu�����C�F�Ew�ç ;�n?�*o���B�8�bʝ���'#Rqf����M}7����]�������s2tcS{�\icTx;�\��7K���P������ʇ Z O-��~�������c>"��?��������P�����E��O�8��@�8��G��Q�g�a�Վ���󁶠��䧘��_%#r�>�����1�z�a���eb��qcP��ѵ��n���#L��� =��׀t� L�7�`�����V����A{�C:�g���e@�����w1 Xp�3�c3�ġ�������p��M"'-�@n4���fG���B3�DJ�8[Jo�ߐ���gK)ƛ��$���� �������8�3�����+���� �����6�ʻ���� ���S�kI�*KZlT _`�������?��K�����QK�d���������B`�s}�>���`������*�>��,*@J�d�oF*�����弝��O}�k��s��]��y�ߘ�������c1G�V���<=�7��7����6��q�PT��tXԀ�!9*4�4Tހ���3XΛex�46�������Y��D ����� ����BdemDa����\�_l,����G�/���֌7���Y�](�xTt^%�GE�����4�}bT����ڹ�����;��Y)���B�Q��u��>J/J ���⮶.�XԄ��j�ݳ������+E��d ���r�5�_D�����1 ���o�� �B�x�΢�#����<��W�����8���R6�@���g�M�.��� dr�D��>(otU��@�x=��~v���2� ӣ�d�oBd�����3�eO�6�㣷����������ݜ�6��6Y��Qz`����S��{���\P��~z m5{J/L��1������<�e�ͅPu���b�]�ϔ��������'�������f�b� Zpw��c`"��i���BD@:)ִ�:�]��h���v�E��w���T�l�������P����"Ju�}��وV ��J��G6��. J/�Qgl߭�e�����@�z�Zev2u����)]կ���������7x�������s�M�-<ɯ�c��r��v�����@��$�ޮ}lk���a����'����>x��O\�Z������Fu>������ck#��&:��`�$��ai�>2Δ����l���oF[h�������lE�ܺ�Π���k:)���`������� $[6�����9�����kOw�\|�����8}������ބ:��񶐕��������I�A1/���=�2[�,�!��.}gN#�u����b���� ~���������݊��}34q�����d�E��L��������c��$���"�[q�U�硬g^��%B ��z���r�p�������J�ru%v\h�����1Y�ne`������ǥ:g����pQM~�^��Xi� ��`S�:V2������9.�P���V������?B�k�� ��������AEvw%�_�9C�Q����wKekP�ؠ�\������;Io d�{ ߞo�c1eP�����\� `����E=���@K<�Y��������eڼ�J����w����{av�F�'�M�@��������������/J��+9p����|]���������Iw &`���8���&�M�hg���[�{�������Xj���%��Ӓ�������������������$��(�����ʹN�������<>�I���RY�����K2�NPlL�ɀ�)��&e��������B+ь����(������������������� � �JTx����_?EZ� }@���� 6�U���뙢ط�z��dWI��n` D����噥�[��uV��"�G&�����Ú����2�g�}&m���������������������?ċ���"����Om#�������������������������� ��{���������������������ON��"S�X���Ne��ysQ���@�������������Fn��Vg�����dX�~nj����������������������]J�<�K]:����FW���b�������62����������=��5f����JKw����bf�X������������������������55��~J �%^�������:�-�QIE��P��v�nZum� z � ~ə ���� ���ة����;�f��\v�������g�8�1��f2�������������������������4;�V���ǔ�)�������������������9���1\������������������������������c��v�/'Ƞ�w������������������$�4�R-��t����������������������������������� e�6�/�ġ �̕Ecy�J���u�B���<�W�ַ~�w[B1L۲�-JS΂�{���΃�������������������������������������������A��20�c#���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@���� 0!1@AP"#2Q`$3V�%45a6�FRUq����� ������^7ׅ,$n��������+��F�`��2X'��0vM��p�L=�������5��8������u�p~���.�`r�����\����O��,ư�0oS ��_�M�����l���4�kv\JSd���x���SW�<��Ae�IX����������$I���w�:S���y���›R��9�Q[���,�5�;�@]�%���u�@ *ro�lbI �� ��+���%m:�͇ZV�����u�̉����θau<�fc�.����{�4Ա� �Q����*�Sm��8\ujqs]{kN���)qO�y�_*dJ�b�7���yQqI&9�ԌK!�M}�R�;�������S�T���1���i[U�ɵz�]��U)V�S6���3$K{��ߊ<�(� E]Զ[ǼENg�����'�\?#)Dkf��J���o��v���'�%ƞ�&K�u��!��b�35LX�Ϸ��63$K�a�;�9>,R��W��3�3� d�JeTYE.Mϧ��-�o�j3+y��y^�c�������VO�9NV\nd�1 ��!͕_)a�v;����թ�M�lWR1��)El��P;��yوÏ�u 3�k�5Pr6<�⒲l�!˞*��u־�n�!�l:����UNW ��%��Chx8vL'��X�@��*��)���̮��ˍ��� ����D-M�+J�U�kvK����+�x8��cY������?�Ԡ��~3mo��|�u@[XeY�C�\Kp�x8�oC�C�&����N�~3-H���� ��MX�s�u<`���~"WL��$8ξ��3���a�)|:@�m�\���^�`�@ҷ)�5p+��6���p�%i)P M���ngc�����#0Aruz���RL+xSS?���ʮ}()#�t��mˇ!��0}}y����<�e� �-ή�Ԩ��X������ MF���ԙ~l L.3���}�V뽺�v������멬��Nl�)�2����^�Iq��a��M��qG��T�����c3#������3U�Ǎ���}��לS�|qa��ڃ�+���-��2�f����/��bz��ڐ�� �ݼ[2�ç����k�X�2�* �Z�d���J�G����M*9W���s{��w���T��x��y,�in�O�v��]���n����P�$��JB@=4�OTI�n��e�22a\����q�d���%�$��(���:���: /*�K[PR�fr\nڙdN���F�n�$�4��[�� U�zƶ����� �mʋ���,�ao�u 3�z� �x��Kn����\[��VFmbE;�_U��&V�Gg�]L�۪&#n%�$ɯ��dG���D�TI=�%+AB�Ru#��b4�1�»x�cs�YzڙJG��f��Il���d�eF'T� iA��T���uC�$����Y��H?����[!G`}���ͪ� �纤Hv\������j�Ex�K���!���OiƸ�Yj�+u-<���'q����uN�*�r\��+�]���<�wOZ.fp�ێ��,-*)V?j-kÊ#�`�r��dV����(�ݽBk�����G�ƛk�QmUڗe��Z���f}|����8�8��a���i��3'J�����~G_�^���d�8w������ R�`(�~�.��u���l�s+g�bv���W���lGc}��u���afE~1�Ue������Z�0�8�=e�� f@/�jqEKQQ�J���oN��J���W5~M>$6�Lt�;$ʳ{���^��6�{����v6���ķܰg�V�cnn �~z�x�«�,2�u�?cE+Ș�H؎�%�Za�)���X>uW�Tz�Nyo����s���FQƤ��$��*�&�LLXL)�1�" L��eO��ɟ�9=���:t��Z���c��Ž���Y?�ӭV�wv�~,Y��r�ۗ�|�y��GaF�����C�����.�+� ���v1���fήJ�����]�S��T��B��n5sW}y�$��~z�'�c ��8 ��� ,! �p��VN�S��N�N�q��y8z˱�A��4��*��'������2n<�s���^ǧ˭P�Jޮɏ�U�G�L�J�*#��<�V��t7�8����TĜ>��i}K%,���)[��z�21z ?�N�i�n1?T�I�R#��m-�����������������1����lA�`��fT5+��ܐ�c�q՝��ʐ��,���3�f2U�եmab��#ŠdQ�y>\��)�SLY����w#��.���ʑ�f��� ,"+�w�~�N�'�c�O�3F�������N<���)j��&��,-� �љ���֊�_�zS���TǦ����w�>��?�������n��U仆�V���e�����0���$�C�d���rP �m�׈e�Xm�Vu� �L��.�bֹ��� �[Դaզ���*��\y�8�Է:�Ez\�0�Kq�C b��̘��cө���Q��=0Y��s�N��S.����3.���O�o:���#���v7�[#߫ ��5�܎�L���Er4���9n��COWlG�^��0k�%<���ZB���aB_���������'=��{i�v�l�$�uC���mƎҝ{�c㱼�y]���W�i ��ߧc��m�H� m�"�"�����;Y�ߝ�Z�Ǔ�����:S#��|}�y�,/k�Ld� TA�(�AI$+I3��;Y*���Z��}|��ӧO��d�v��..#:n��f>�>���ȶI�TX��� 8��y����"d�R�|�)0���=���n4��6ⲑ�+��r<�O�܂~zh�z����7ܓ�HH�Ga롏���nCo�>������a ���~]���R���̲c?�6(�q�;5%� |�uj�~z8R�=X��I�V=�|{v�Gj\gc��q����z�؋%M�ߍ����1y��#��@f^���^�>N������#x#۹��6�Y~�?�dfPO��{��P�4��V��u1E1J �*|���%����JN��`eWu�zk M6���q t[�� ��g�G���v��WIG��u_ft����5�j�"�Y�:T��ɐ���*�;� e5���4����q$C��2d�}���� _S�L#m�Yp��O�.�C�;��c����Hi#֩%+) �Ӎ��ƲV���SYź��g |���tj��3�8���r|���V��1#;.SQ�A[���S������#���`n�+���$��$�I �P\[�@�s��(�ED�z���P��])8�G#��0B��[ى��X�II�q<��9�~[Z멜�Z�⊔IWU&A>�P~�#��dp<�?����7���c��'~���5 ��+$���lx@�M�dm��n<=e�dyX��?{�|Aef ,|n3�<~z�ƃ�uۧ�����P��Y,�ӥQ�*g�#먙R�\���;T��i,��[9Qi歉����c>]9�� ��"�c��P�� �Md?٥��If�ت�u��k��/����F��9�c*9��Ǎ:�ØF���z�n*�@|I�ށ9����N3{'��[�'ͬ�Ҳ4��#}��!�V� Fu��,�,mTIk���v C�7v���B�6k�T9��1�*l� '~��ƞF��lU��'�M ����][ΩũJ_�{�i�I�n��$����L�� j��O�dx�����kza۪��#�E��Cl����x˘�o�����V���ɞ�ljr��)�/,�߬h�L��#��^��L�ф�,íMƁe�̩�NB�L�����iL����q�}��(��q��6IçJ$�W�E$��:������=#����(�K�B����zђ <��K(�N�۫K�w��^O{!����)��H���>x�������lx�?>Պ�+�>�W���,Ly!_�D���Ō�l���Q�!�[ �S����J��1��Ɛ�Y}��b,+�Lo�x�ɓ)����=�y�oh�@�꥟/��I��ѭ=��P�y9��� �ۍYӘ�e+�p�Jnϱ?V\SO%�(�t� ���=?MR�[Ș�����d�/ ��n�l��B�7j� ��!�;ӥ�/�[-���A�>��dN�sLj ��,ɪv��=1c�.SQ�O3�U���ƀ�ܽ�E����������̻��9G�ϷD�7(�}��Ävӌ\��y�_0[w ���<΍>����a_��[0+�L��F.�޺��f�>oN�T����q;���y\��bՃ��y�jH�<|q-eɏ�_?_9+P���Hp$�����[ux�K w�Mw��N�ی'$Y2�=��q���KB��P��~�������Yul:�[<����F1�2�O���5=d����]Y�sw:���Ϯ���E��j,_Q��X��z`H1,#II ��d�wr��P˂@�ZJV����y$�\y�{}��^~���[:N����ߌ�U�������O��d�����ؾe��${p>G��3c���Ė�lʌ�� ת��[��`ϱ�-W����dg�I��ig2��� ��}s ��ؤ(%#sS@���~���3�X�nRG�~\jc3�v��ӍL��M[JB�T��s3}��j�Nʖ��W����;7���ç?=X�F=-�=����q�ߚ���#���='�c��7���ڑW�I(O+=:uxq�������������e2�zi+�kuG�R��������0�&e�n���iT^J����~\jy���p'dtG��s����O��3����9* �b#Ɋ�� p������[Bws�T�>d4�ۧs���nv�n���U���_�~,�v����ƜJ1��s�� �QIz���)�(lv8M���U=�;����56��G���s#�K���MP�=��LvyGd��}�VwWBF�'�à �?MH�U�g2�� ����!�p�7Q��j��ڴ����=��j�u��� Jn�A s���uM������e��Ɔ�Ҕ�!)�'��8Ϣ�ٔ���ޝ(��Vp���צ֖d=�IC�J�Ǡ{q������kԭ�߸���i��@K����u�|�p=..�*+����x�����z[Aqġ#s2a�Ɗ���RR�)*HRsi�~�a &f��M��P����-K�L@��Z��Xy�'x�{}��Zm+���:�)�) IJ�-i�u���� ���ܒH��'��L(7�y�GӜq���� j��� 6ߌg1�g�o���,kر���tY�?W,���p���e���f�OQS��!K�۟cҒA�|ս�j�>��=⬒��˧L[�� �߿2JaB~R��u�:��Q�] �0H~���]�7��Ƽ�I���(�}��cq '�ήET���q�?f�ab���ӥvr� �)o��-Q��_'����ᴎo��K������;��V���o��%���~OK ����*��b�f:���-ťIR��`B�5!RB@���ï�� �u �̯e\�_U�_������� g�ES��3��������QT��a�����x����U<~�c?�*�#]�MW,[8O�a�x��]�1bC|踤�P��lw5V%�)�{t�<��d��5���0i�XSU��m:��Z�┵�i�"��1�^B�-��P�hJ��&)O��*�D��c�W��vM��)����}���P��ܗ-q����\mmζZ-l@�}��a��E�6��F�@��&Sg@���ݚ�M����� ȹ 4����#p�\H����dYDo�H���"��\��..R�B�H�z_�/5˘����6��KhJR��P�mƶi�m���3��,#c�co��q�a)*P�t����R�m�k�7x�D�E�\Y�閣_X�<���~�)���c[[�BP����6�Yq���S��0����%_����;��Àv�~�| VS؇ ��'O0��F0��\���U�-�d@�����7�SJ*z��3n��y��P����O����������m�~�P�3|Y��ʉr#�C�<�G~�.,! ���bqx���h~0=��!ǫ�jy����l��O,�[B��~��|9��ٱ����Xly�#�i�B��g%�S��������tˋ���e���ې��\[d�t)��.+u�|1 ������#�~Oj����hS�%��i.�~X���I�H�m��0n���c�1uE�q��cF�RF�o���7� �O�ꮧ� ���ۛ{��ʛi5�rw?׌#Qn�TW��~?y$��m\�\o����%W� ?=>S�N@�� �Ʈ���R����N�)�r"C�:��:����� �����#��qb��Y�. �6[��2K����2u�Ǧ�HYR��Q�MV��� �G�$��Q+.>�����nNH��q�^��� ����q��mM��V��D�+�-�#*�U�̒ ���p욳��u:�������IB���m����PV@O���r[b= �� ��1U�E��_Nm�yKbN�O���U�}�the�`�|6֮P>�\2�P�V���I�D�i�P�O;�9�r�mAHG�W�S]��J*�_�G��+kP�2����Ka�Z���H�'K�x�W�MZ%�O�YD�Rc+o��?�q��Ghm��d�S�oh�\�D�|:W������UA�Qc yT�q��������~^�H��/��#p�CZ���T�I�1�ӏT����4��"�ČZ�����}��`w�#�*,ʹ�� ��0�i��課�Om�*�da��^gJ݅{���l�e9uF#T�ֲ��̲�ٞC"�q���ߍ ոޑ�o#�XZTp����@ o�8��(jd��xw�]�,f���`~��|,s��^����f�1���t��|��m�򸄭/ctr��5s��7�9Q�4�H1꠲BB@�l9@���C�����+�wp�xu�£Yc�9��?`@#�o�mH�s2��)�=��2�.�l����jg�9$�Y�S�%*L������R�Y������7Z���,*=�䷘$�������arm�o�ϰ���UW.|�r�uf����IGw�t����Zwo��~5 ��YյhO+=8fF�)�W�7�L9lM�̘·Y���֘YLf�큹�pRF���99.A �"wz��=E\Z���'a� 2��Ǚ�#;�'}�G���*��l��^"q��+2FQ� hj��kŦ��${���ޮ-�T�٭cf�|�3#~�RJ����t��$b�(R��(����r���dx� >U b�&9,>���%E\� Ά�e�$��'�q't��*�א���ެ�b��-|d���SB�O�O��$�R+�H�)�܎�K��1m`;�J�2�Y~9��O�g8=vqD`K[�F)k�[���1m޼c��n���]s�k�z$@��)!I �x՝"v��9=�ZA=`Ɠi �:�E��)`�7��vI��}d�YI�_ �o�:ob���o ���3Q��&D&�2=�� �Ά��;>�h����y.*ⅥS������Ӭ�+q&����j|UƧ�����}���J0��WW< ۋS�)jQR�j���Ư��rN)�Gű�4Ѷ(�S)Ǣ�8��i��W52���No˓� ۍ%�5brOn�L�;�n��\G����=�^U�dI���8$�&���h��'���+�(������cȁ߫k�l��S^���cƗjԌE�ꭔ��gF���Ȓ��@���}O���*;e�v�WV���YJ\�]X'5��ղ�k�F��b 6R�o՜m��i N�i�����>J����?��lPm�U��}>_Z&�KK��q�r��I�D�Չ~�q�3fL�:S�e>���E���-G���{L�6p�e,8��������QI��h��a�Xa��U�A'���ʂ���s�+טIjP�-��y�8ۈZ?J$��W�P� ��R�s�]��|�l(�ԓ��sƊi��o(��S0���Y� 8�T97.�����WiL��c�~�dxc�E|�2!�X�K�Ƙਫ਼�$((�6�~|d9u+�qd�^3�89��Y�6L�.I�����?���iI�q���9�)O/뚅����O���X��X�V��ZF[�یgQ�L��K1���RҖr@v�#��X�l��F���Нy�S�8�7�kF!A��sM���^rkp�jP�DyS$N���q���nxҍ!U�f�!eh�i�2�m����`�Y�I�9r�6� �TF���C}/�y�^���Η���5d�'��9A-��J��>{�_l+�`��A���[�'��յ�ϛ#w:݅�%��X�}�&�PSt�Q�"�-��\縵�/����$Ɨh�Xb�*�y��BS����;W�ջ_mc�����vt?2}1�;qS�d�d~u:2k5�2�R�~�z+|HE!)�Ǟl��7`��0�<�,�2*���Hl-��x�^����'_TV�gZA�'j� ^�2Ϊ��N7t�����?w�� �x1��f��Iz�C-Ȗ��K�^q�;���-W�DvT�7��8�Z�������� hK�(P:��Q- �8�n�Z���܃e貾�<�1�YT<�,�����"�6{�/ �?�͟��|1�:�#g��W�>$����d��J��d�B���=��jf[��%rE^��il:��B���x���Sּ�1հ��,�=��*�7 fcG��#q� �eh?��2�7�����,�!7x��6�n�LC�4x��},Geǝ�tC.��vS �F�43��zz\��;QYC,6����~;RYS/6���|2���5���v��T��i����������mlv��������&� �nRh^ejR�LG�f���? �ۉҬܦƩ��|��Ȱ����>3����!v��i�ʯ�>�v��オ�X3e���_1z�Kȗ\<������!�8���V��]��?b�k41�Re��T�q��mz��TiOʦ�Z��Xq���L������q"+���2ۨ��8}�&N7XU7Ap�d�X��~�׿��&4e�o�F��� �H�����O���č�c�� 懴�6���͉��+)��v;j��ݷ�� �UV�� i��� j���Y9GdÒJ1��詞�����V?h��l�����l�cGs�ځ�������y�Ac������\V3�? �� ܙg�>qH�S,�E�W�[�㺨�uch�⍸�O�}���a��>�q�6�n6�����N6�q��������N� ���! 1AQaq�0@����"2BRb�#Pr���3C`��Scst���$4D���%Td���� ?�����N����a��3��m���C���w��������xA�m�q�m����m������$����4n淿t'��C"w��zU=D�\R+w�p+Y�T�&�պ@��ƃ��3ޯ?�Aﶂ��aŘ���@-�����Q�=���9D��ռ�ѻ@��M�V��P��܅�G5�f�Y<�u=,EC)�<�Fy'�"�&�չ�X~f��l�KԆV��?�� �W�N����=(� �;���{�r����ٌ�Y���h{�١������jW����P���Tc�����X�K�r��}���w�R��%��?���E��m�� �Y�q|����\lEE4����r���}�lsI�Y������f�$�=�d�yO����p�����yBj8jU�o�/�S��?�U��*������ˍ�0�������u�q�m [�?f����a�� )Q�>����6#������� ?����0UQ����,IX���(6ڵ[�DI�MNލ�c&���υ�j\��X�R|,4��� j������T�hA�e��^���d���b<����n�� �즇�=!���3�^�`j�h�ȓr��jẕ�c�,ٞX����-����a�ﶔ���#�$��]w�O��Ӫ�1y%��L�Y<�wg#�ǝ�̗`�x�xa�t�w��»1���o7o5��>�m뭛C���Uƃߜ}�C���y1Xνm�F8�jI���]����H���ۺиE@I�i;r�8ӭ�����V�F�Շ| ��&?�3|x�B�MuS�Ge�=Ӕ�#BE5G������Y!z��_e��q�р/W>|-�Ci߇�t�1ޯќd�R3�u��g�=0 5��[?�#͏��q�cf���H��{ ?u�=?�?ǯ���}Z��z���hmΔ�BFTW�����<�q��(v� ��!��z���iW]*�J�V�z��gX֧A�q�&��/w���u�gYӘa���; �i=����g:��?2�dž6�ى�k�4�>�Pxs����}������G�9���3 ���)gG�R<>r h�$��'nc�h�P��Bj��J�ҧH� -��N1���N��?��~��}-q!=��_2hc�M��l�vY%UE�@|�v����M2�.Y[|y�"Eï��K�ZF,�ɯ?,q�?v�M 80jx�"�;�9vk�����+ ֧�� �ȺU��?�%�vcV��mA�6��Qg^M�����A}�3�nl� QRN�l8�kkn�'�����(��M�7m9و�q���%ޟ���*h$Zk"��$�9��: �?U8�Sl��,,|ɒ��xH(ѷ����Gn�/Q�4�P��G�%��Ա8�N��!� �&�7�;���eKM7�4��9R/%����l�c>�x;������>��C�:�����t��h?aKX�bhe�ᜋ^�$�Iհ �hr7%F$�E��Fd���t��5���+�(M6�t����Ü�UU|zW�=a�Ts�Tg������dqP�Q����b'�m���1{|Y����X�N��b �P~��F^F:����k6�"�j!�� �I�r�`��1&�-$�Bevk:y���#y�w��I0��x��=D�4��tU���P�ZH��ڠ底taP��6����b>�xa�����Q�#� WeF��ŮNj�p�J* mQ�N�����*I�-*�ȩ�F�g�3 �5��V�ʊ�ɮ�a��5F���O@{���NX��?����H�]3��1�Ri_u��������ѕ�� ����0��� F��~��:60�p�͈�S��qX#a�5>���`�o&+�<2�D����: �������ڝ�$�nP���*)�N�|y�Ej�F�5ټ�e���ihy�Z �>���k�bH�a�v��h�-#���!�Po=@k̆IEN��@��}Ll?j�O������߭�ʞ���Q|A07x���wt!xf���I2?Z��<ץ�T���cU�j��]���陎Ltl �}5�ϓ��$�,��O�mˊ�;�@O��jE��j(�ا,��LX���LO���Ц�90�O �.����a��nA���7������j4 ��W��_ٓ���zW�jcB������y՗+EM�)d���N�g6�y1_x��p�$Lv�:��9�"z��p���ʙ$��^��JԼ*�ϭ����o���=x�Lj�6�J��u82�A�H�3$�ٕ@�=Vv�]�'�qEz�;I˼��)��=��ɯ���x �/�W(V���p�����$ �m�������u�����񶤑Oqˎ�T����r��㠚x�sr�GC��byp�G��1ߠ�w e�8�$⿄����/�M{*}��W�]˷.�CK\�ުx���/$�WP�w���r� |i���&�}�{�X� �>��$-��l���?-z���g����lΆ���(F���h�vS*���b���߲ڡn,|)mrH[���a�3�ר�[1��3o_�U�3�TC�$��(�=�)0�kgP���� ��u�^=��4 �WYCҸ:��vQ�ר�X�à��tk�m,�t*��^�,�}D*�� �"(�I��9R����>`�`��[~Q]�#af��i6l��8���6�:,s�s�N6�j"�A4���IuQ��6E,�GnH��zS�HO�uk�5$�I�4��ؤ�Q9�@��C����wp��BGv[]�u�Ov����0I4���\��y�����Q�Ѹ��~>Z��8�T��a��q�ޣ;z��a���/��S��I:�ܫ_�|������>=Z����8:�S��U�I�J��"IY���8%b8���H��:�QO�6�;7�I�S��J��ҌAά3��>c���E+&jf$eC+�z�;��V����� �r���ʺ������my�e���aQ�f&��6�ND���.:��NT�vm�<- u���ǝ\MvZY�N�NT��-A�>jr!S��n�O 1�3�Ns�%�3D@���`������ܟ 1�^c<���� �a�ɽ�̲�Xë#�w�|y�cW�=�9I*H8�p�^(4���՗�k��arOcW�tO�\�ƍR��8����'�K���I�Q�����?5�>[�}��yU�ײ -h��=��% q�ThG�2�)���"ו3]�!kB��*p�FDl�A���,�eEi�H�f�Ps�����5�H:�Փ~�H�0Dت�D�I����h�F3�������c��2���E��9�H��5�zԑ�ʚ�i�X�=:m�xg�hd(�v����׊�9iS��O��d@0ڽ���:�p�5�h-��t�&���X�q�ӕ,��ie�|���7A�2���O%P��E��htj��Y1��w�Ѓ!����  ���� ࢽ��My�7�\�a�@�ţ�J ��4�Ȼ�F�@o�̒?4�wx��)��]�P��~�����u�����5�����7X ��9��^ܩ�U;Iꭆ 5 �������eK2�7(�{|��Y׎ �V��\"���Z�1� Z�����}��(�Ǝ"�1S���_�vE30>���p;� ΝD��%x�W�?W?v����o�^V�i�d��r[��/&>�~`�9Wh��y�;���R���� ;;ɮT��?����r$�g1�K����A��C��c��K��l:�'��3 c�ﳯ*"t8�~l��)���m��+U,z��`(��>yJ�?����h>��]��v��ЍG*�{`��;y]��I�T� ;c��NU�fo¾h���/$���|NS���1�S�"�H��V���T���4��uhǜ�]�v;���5�͠x��'C\�SBpl���h}�N����� A�Bx���%��ޭ�l��/����T��w�ʽ]D�=����K���ž�r㻠l4�S�O?=�k �M:� ��c�C�a�#ha���)�ѐxc�s���gP�iG���{+���x���Q���I= �� z��ԫ+ �8"�k�ñ�j=|����c ��y��CF��/���*9ж�h{ �?4�o� ��k�m�Q�N�x��;�Y��4膚�a�w?�6�>�e]�����Q�r�:����g�,i"�����ԩA��*M�<�G��b�if��l^M��5�� �Ҩ�{����6J��ZJ�����P�*�����Y���ݛu�_4�9�I8�7���������,^ToR���m4�H��?�N�S�ѕw��/S��甍�@�9H�S�T��t�ƻ���ʒU��*{Xs�@����f������֒Li�K{H�w^���������Ϥm�tq���s� ���ք��f:��o~s��g�r��ט� �S�ѱC�e]�x���a��) ���(b-$(�j>�7q�B?ӕ�F��hV25r[7 Y� }L�R��}����*sg+��x�r�2�U=�*'WS��ZDW]�WǞ�<��叓���{�$�9Ou4��y�90-�1�'*D`�c�^o?(�9��u���ݐ��'PI&� f�Jݮ�������:wS����jfP1F:X �H�9dԯ����˝[�_54 �}*;@�ܨ�� ð�yn�T���?�ןd�#���4rG�ͨ��H�1�|-#���Mr�S3��G�3�����)�.᧏3v�z֑��r����$G"�`j �1t��x0<Ɔ�Wh6�y�6��,œ�Ga��gA����y��b��)���h�D��ß�_�m��ü �gG;��e�v��ݝ�nQ� ��C����-�*��o���y�a��M��I�>�<���]obD��"�:���G�A��-\%LT�8���c�)��+y76���o�Q�#*{�(F�⽕�y����=���rW�\p���۩�c���A���^e6��K������ʐ�cVf5$�'->���ՉN"���F�"�UQ@�f��Gb~��#�&�M=��8�ט�JNu9��D��[̤�s�o�~������� G��9T�tW^g5y$b��Y'��س�Ǵ�=��U-2 #�MC�t(�i� �lj�@Q 5�̣i�*�O����s�x�K�f��}\��M{E�V�{�υ��Ƈ�����);�H����I��fe�Lȣr�2��>��W��I�Ȃ6������i��k�� �5�YOxȺ����>��Y�f5'��|��H+��98pj�n�.O�y�������jY��~��i�w'������l�;�s�2��Y��:'lg�ꥴ)o#'Sa�a�K��Z� �m��}�`169�n���"���x��I ��*+� }F<��cГ���F�P�������ֹ*�PqX�x۩��,� ��N�� �4<-����%����:��7����W���u�`����� $�?�I��&����o��o��`v�>��P��"��l���4��5'�Z�gE���8���?��[�X�7(��.Q�-��*���ތL@̲����v��.5���[��=�t\+�CNܛ��,g�SQnH����}*F�G16���&:�t��4ُ"A��̣��$�b �|����#rs��a�����T�� ]�<�j��B�S�('$�ɻ� �wP;�/�n��?�ݜ��x�F��yUn�~mL*-�������Xf�wd^�a�}��f�,=t�׵i�.2/wpN�Ep8�OР���•��R�FJ� 55TZ��T �ɭ�<��]��/�0�r�@�f��V��V����Nz�G��^���7hZi����k��3�,kN�e|�vg�1{9]_i��X5y7� 8e]�U����'�-2,���e"����]ot�I��Y_��n�(JҼ��1�O ]bXc���Nu�No��pS���Q_���_�?i�~�x h5d'�(qw52] ��'ޤ�q��o1�R!���`ywy�A4u���h<קy���\[~�4�\ X�Wt/� 6�����n�F�a8��f���z �3$�t(���q��q�x��^�XWeN'p<-v�!�{�(>ӽDP7��ո0�y)�e$ٕv�Ih'Q�EA�m*�H��RI��=:��� ���4牢) �%_iN�ݧ�l]� �Nt���G��H�L��� ɱ�g<���1V�,�J~�ٹ�"K��Q�� 9�HS�9�?@��k����r�;we݁�]I�!{ �@�G�[�"��`���J:�n]�{�cA�E����V��ʆ���#��U9�6����j�#Y�m\��q�e4h�B�7��C�������d<�?J����1g:ٳ���=Y���D�p�ц� ׈ǔ��1�]26؜oS�'��9�V�FVu�P�h�9�xc�oq�X��p�o�5��Ա5$�9W�V(�[Ak�aY錎qf;�'�[�|���b�6�Ck��)��#a#a˙��8���=äh�4��2��C��4tm^ �n'c����]GQ$[Wҿ��i���vN�{Fu ��1�gx��1┷���N�m��{j-,��x�� Ūm�ЧS�[�s���Gna���䑴�� x�p 8<������97�Q���ϴ�v�aϚG��Rt�Һ׈�f^\r��WH�JU�7Z���y)�vg=����n��4�_)y��D'y�6�]�c�5̪��\� �PF�k����&�c;��cq�$~T�7j ���nç]�<�g ":�to�t}�159�<�/�8������m�b�K#g'I'.W������6��I/��>v��\�MN��g���m�A�yQL�4u�Lj�j9��#44�t��l^�}L����n��R��!��t��±]��r��h6ٍ>�yҏ�N��fU�� ���� Fm@�8}�/u��jb9������he:A�y�ծw��GpΧh�5����l}�3p468��)U��d��c����;Us/�֔�YX�1�O2��uq�s��`hwg�r~�{ R��mhN��؎*q 42�*th��>�#���E����#��Hv�O����q�}������6�e��\�,Wk�#���X��b>��p}�դ��3���T5��†��6��[��@��P�y*n��|'f�֧>�lư΂�̺����SU�'*�q�p�_S�����M�� '��c�6������m�� ySʨ;M��r���Ƌ�m�Kxo,���Gm�P��A�G�:��i��w�9�}M(�^�V��$ǒ�ѽ�9���|���� �a����J�SQ�a���r�B;����}���ٻ֢�2�%U���c�#�g���N�a�ݕ�'�v�[�OY'��3L�3�;,p�]@�S��{ls��X�'���c�jw��k'a�.��}�}&�� �dP�*�bK=ɍ!����;3n�gΊU�ߴmt�'*{,=SzfD� A��ko~�G�aoq�_mi}#�m�������P�Xhύ�����mxǍ�΂���巿zf��Q���c���|kc�����?���W��Y�$���_Lv����l߶��c���`?����l�j�ݲˏ!V��6����U�Ђ(A���4y)H���p�Z_�x��>���e���R��$�/�`^'3qˏ�-&Q�=?��CFVR �D�fV�9��{�8g�������n�h�(P"��6�[�D���< E�����~0<@�`�G�6����Hг�cc�� �c�K.5��D��d�B���`?�XQ��2��ٿyqo&+�1^� DW�0�ꊩ���G�#��Q�nL3��c���������/��x ��1�1�[y�x�პCW��C�c�UĨ80�m�e�4.{�m��u���I=��f�����0QRls9���f���������9���~f�����Ǩ��a�"@�8���ȁ�Q����#c�ic������G��$���G���r/$W�(��W���V�"��m�7�[m�A�m����bo��D� j����۳� l���^�k�h׽����� ��#� iXn�v��eT�k�a�^Y�4�BN���ĕ���0������� !01@Q"2AaPq3BR�������?�����@4�Q�����T3,���㺠�W�[=JK�Ϟ���2�r^7��vc�:�9 �E�ߴ�w�S#d���Ix��u��:��Hp��9E!�� V 2;73|F��9Y���*ʬ�F��D����u&���y؟��^EA��A��(ɩ���^��GV:ݜDy�`��Jr29ܾ�㝉��[���E;Fzx��YG��U�e�Y�C���� ����v-tx����I�sם�Ę�q��Eb�+P\ :>�i�C'�;�����k|z�رn�y]�#ǿb��Q��������w�����(�r|ӹs��[�D��2v-%��@;�8<a���[\o[ϧw��I!��*0�krs)�[�J9^��ʜ��p1)� "��/_>��o��<1����A�E�y^�C��`�x1'ܣn�p��s`l���fQ��):�l����b>�Me�jH^?�kl3(�z:���1ŠK&?Q�~�{�ٺ�h�y���/�[��V�|6��}�KbX����mn[-��7�5q�94�������dm���c^���h� X��5��<�eޘ>G���-�}�دB�ޟ� ��|�rt�M��V+�]�c?�-#ڛ��^ǂ}���Lkr���O��u�>�-D�ry� D?:ޞ�U��ǜ�7�V��?瓮�"�#���r��չģVR;�n���/_� ؉v�ݶe5d�b9��/O��009�G���5n�W����JpA�*�r9�>�1��.[t���s�F���nQ� V 77R�]�ɫ8����_0<՜�IF�u(v��4��F�k�3��E)��N:��yڮe��P�`�1}�$WS��J�SQ�N�j��ٺ��޵�#l���ј(�5=��5�lǏmoW�v-�1����v,W�mn��߀$x�<����v�j(����c]��@#��1������Ǔ���o'��u+����;G�#�޸��v-lη��/(`i⣍Pm^����ԯ̾9Z��F��������n��1��� ��]�[��)�'�������:�֪�W��FC����� �B9،!?���]��V��A�Վ�M��b�w��G F>_DȬ0¤�#�QR�[V��kz���m�w�"��9ZG�7'[��=�Q����j8R?�zf�\a�=��O�U����*oB�A�|G���2�54 �p��.w7� �� ���&������ξxGHp� B%��$g�����t�Џ򤵍z���HN�u�Я�-�'4��0���;_���3������� !01"@AQa2Pq#3BR�������?����ʩca��en��^��8���<�u#��m*08r��y�N"�<�Ѳ0��@\�p��� �����Kv�D��J8�Fҽ� �f�Y��-m�ybX�NP����}�!*8t(�OqѢ��Q�wW�K��ZD��Δ^e��!� ��B�K��p~�����e*l}z#9ң�k���q#�Ft�o��S�R����-�w�!�S���Ӥß|M�l޶V��!eˈ�8Y���c�ЮM2��tk���� ������J�fS����Ö*i/2�����n]�k�\���|4yX�8��U�P.���Ы[���l��@"�t�<������5�lF���vU�����W��W��;�b�cД^6[#7@vU�xgZv��F�6��Q,K�v��� �+Ъ��n��Ǣ��Ft���8��0��c�@�!�Zq s�v�t�;#](B��-�nῃ~���3g������5�J�%���O������n�kB�ĺ�.r��+���#�N$?�q�/�s�6��p��a����a��J/��M�8��6�ܰ"�*������ɗud"\w���aT(����[��F��U՛����RT�b���n�*��6���O��SJ�.�ij<�v�MT��R\c��5l�sZB>F��<7�;EA��{��E���Ö��1U/�#��d1�a�n.1ě����0�ʾR�h��|�R��Ao�3�m3 ��%�� ���28Q�� ��y��φ���H�To�7�lW>����#i`�q���c����a��� �m,B�-j����݋�'mR1Ήt�>��V��p���s�0IbI�C.���1R�ea�����]H�6�����������4B>��o��](��$B���m�����a�!=���?�B� K�Ǿ+�Ծ"�n���K��*��+��[T#�{�E�J�S����Q�����s�5�:�U�\wĐ�f�3����܆&�)�����I���Ԇw��E T�lrTf6Q|R�h:��[K�� �z��c֧�G�C��%\��_�a��84��HcO�bi��ؖV��7H �)*ģK~Xhչ0��4?�0��� �E<���}3���#���u�?�� ��|g�S�6ꊤ�|�I#Hڛ� �ա��w�X��9��7���Ŀ%�SL��y6č��|�F�a 8���b���$�sק�h���b9RAu7�˨p�Č�_\*w��묦��F ����4D~�f����|(�"m���NK��i�S�>�$d7SlA��/�²����SL��|6N�}���S�˯���g��]6��; �#�.��<���q'Q�1|KQ$�����񛩶"�$r�b:���N8�w@��8$�� �AjfG|~�9F ���Y��ʺ��Bwؒ������M:I岎�G��`s�YV5����6��A �b:�W���G�q%l�����F��H���7�������Fsv7���k�� 403WebShell
403Webshell
Server IP : 103.30.72.248  /  Your IP : 216.73.216.61
Web Server : Microsoft-IIS/10.0
System : Windows NT WIN-CARKG80MF9A 10.0 build 17763 (Windows Server 2019) AMD64
User : IUSR ( 0)
PHP Version : 8.2.7
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files/Azure Data Studio/resources/app/out/vs/code/node/sharedProcess/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Program Files/Azure Data Studio/resources/app/out/vs/code/node/sharedProcess/sharedProcessMain.js
/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/(function(){var ce=["require","exports","vs/base/common/lifecycle","vs/base/common/event","vs/platform/instantiation/common/instantiation","vs/base/common/async","vs/base/common/platform","vs/platform/log/common/log","vs/base/common/errors","vs/nls!vs/code/node/sharedProcess/sharedProcessMain","vs/nls","vs/base/common/uri","vs/base/common/types","vs/platform/files/common/files","vs/base/common/buffer","vs/platform/environment/common/environment","vs/base/common/path","vs/platform/userDataProfile/common/userDataProfile","vs/platform/configuration/common/configuration","vs/platform/storage/common/storage","vs/base/common/arrays","vs/platform/telemetry/common/telemetry","vs/base/common/resources","vs/platform/product/common/productService","vs/platform/userDataSync/common/userDataSync","vs/base/common/cancellation","vs/base/common/network","vs/platform/uriIdentity/common/uriIdentity","vs/base/common/strings","vs/platform/extensionManagement/common/extensionManagement","vs/base/common/objects","vs/base/node/pfs","vs/base/common/uuid","vs/platform/extensionManagement/common/extensionManagementUtil","vs/base/common/json","vs/base/common/map","os","vs/base/common/process","vs/base/common/errorMessage","vs/platform/userDataSync/common/abstractSynchronizer","vs/platform/registry/common/platform","vs/platform/extensions/common/extensions","vs/base/common/jsonFormatter","vs/base/common/stream","vs/base/parts/ipc/common/ipc","vs/platform/externalServices/common/serviceMachineId","vs/platform/telemetry/common/telemetryUtils","vs/base/common/ternarySearchTree","vs/base/common/extpath","vs/platform/configuration/common/configurationRegistry","vs/platform/extensionManagement/common/extensionsProfileScannerService","vs/base/common/hash","fs","vs/base/common/semver/semver","vs/platform/files/common/watcher","vs/platform/native/common/native","vs/platform/policy/common/policy","vs/platform/request/common/request","vs/platform/userDataProfile/common/userDataProfileStorageService","vs/base/common/iterator","net","vs/base/common/date","vs/base/common/marshalling","child_process","vs/base/parts/ipc/common/ipc.net","vs/base/parts/storage/common/storage","vs/platform/extensions/common/extensionValidator","vs/platform/instantiation/common/descriptors","crypto","vs/platform/instantiation/common/serviceCollection","vs/platform/ipc/common/mainProcessService","vs/platform/languagePacks/common/languagePacks","vs/platform/product/common/product","vs/platform/configuration/common/configurationModels","vs/platform/remote/common/remoteHosts","vs/platform/storage/common/storageIpc","vs/platform/tunnel/common/tunnel","vs/platform/userDataSync/common/content","vs/platform/userDataSync/common/userDataSyncAccount","vs/platform/extensionManagement/common/extensionsScannerService","vs/platform/extensionManagement/common/extensionStorage","vs/platform/userDataSync/common/userDataSyncMachines","vs/base/node/zip","vs/base/common/decorators","vs/base/common/functional","vs/base/common/jsonEdit","vs/base/common/lazy","vs/base/common/linkedList","vs/base/common/normalization","vs/base/common/stopwatch","vs/base/common/severity","sql/base/common/locConstants","vs/base/common/processes","vs/base/common/glob","vs/base/common/uriIpc","vs/base/parts/ipc/node/ipc.cp","vs/platform/contextkey/common/contextkey","vs/platform/diagnostics/common/diagnostics","vs/platform/download/common/download","vs/platform/extensionManagement/node/extensionSignatureVerificationService","vs/platform/extensionRecommendations/common/extensionRecommendations","vs/platform/files/common/io","vs/base/common/performance","vs/platform/lifecycle/node/sharedProcessLifecycleService","vs/platform/jsonschemas/common/jsonContributionRegistry","vs/platform/remote/common/remoteSocketFactoryService","vs/platform/remoteTunnel/common/remoteTunnel","vs/platform/sign/common/sign","vs/platform/telemetry/common/commonProperties","vs/platform/telemetry/common/telemetryIpc","vs/platform/telemetry/common/telemetryLogAppender","vs/platform/telemetry/common/telemetryService","vs/platform/userDataSync/common/ignoredExtensions","vs/platform/voiceRecognition/node/voiceRecognitionService","vs/platform/workspace/common/workspace","vs/platform/extensionManagement/common/extensionEnablementService","vs/platform/userDataSync/common/extensionsSync","vs/platform/userDataSync/common/globalStateSync","vs/platform/userDataSync/common/keybindingsSync","vs/platform/userDataSync/common/settingsSync","vs/platform/userDataSync/common/snippetsSync","vs/platform/userDataSync/common/tasksSync","vs/platform/userDataSync/common/userDataProfilesManifestSync","vs/platform/extensionManagement/node/extensionManagementService","vs/base/parts/ipc/node/ipc.net","vs/base/common/amd","vs/base/common/assert","vs/base/common/skipList","vs/base/common/cache","vs/base/common/symbols","vs/base/node/macAddress","vs/base/node/id","vs/base/node/nodeStreams","vs/base/node/ports","vs/base/parts/sandbox/node/electronTypes","vs/nls!sql/base/common/locConstants","vs/nls!vs/base/common/date","vs/nls!vs/base/common/errorMessage","vs/nls!vs/base/common/jsonErrorMessages","vs/base/common/jsonErrorMessages","vs/nls!vs/base/common/platform","vs/base/common/mime","vs/base/common/console","vs/amdX","vs/base/node/extpath","vs/base/node/processes","vs/base/node/ps","vs/base/parts/ipc/node/ipc.mp","vs/nls!vs/base/node/zip","vs/nls!vs/platform/configuration/common/configurationRegistry","vs/nls!vs/platform/contextkey/common/contextkey","vs/nls!vs/platform/contextkey/common/scanner","vs/nls!vs/platform/extensionManagement/common/abstractExtensionManagementService","vs/nls!vs/platform/extensionManagement/common/extensionManagement","vs/nls!vs/platform/extensionManagement/common/extensionNls","vs/nls!vs/platform/extensionManagement/common/extensionsScannerService","vs/nls!vs/platform/extensionManagement/node/extensionManagementService","vs/nls!vs/platform/extensionManagement/node/extensionManagementUtil","vs/nls!vs/platform/extensions/common/extensionValidator","vs/nls!vs/platform/files/common/fileService","vs/nls!vs/platform/files/common/files","vs/nls!vs/platform/files/common/io","vs/nls!vs/platform/files/node/diskFileSystemProvider","vs/nls!vs/platform/languagePacks/common/languagePacks","vs/nls!vs/platform/remoteTunnel/common/remoteTunnel","vs/nls!vs/platform/remoteTunnel/node/remoteTunnelService","vs/nls!vs/platform/request/common/request","vs/nls!vs/platform/telemetry/common/telemetryLogAppender","vs/nls!vs/platform/telemetry/common/telemetryService","vs/nls!vs/platform/userDataProfile/common/userDataProfile","vs/nls!vs/platform/userDataSync/common/abstractSynchronizer","vs/nls!vs/platform/userDataSync/common/keybindingsSync","vs/nls!vs/platform/userDataSync/common/settingsSync","vs/nls!vs/platform/userDataSync/common/userDataAutoSyncService","vs/nls!vs/platform/userDataSync/common/userDataSync","vs/nls!vs/platform/userDataSync/common/userDataSyncLog","vs/nls!vs/platform/userDataSync/common/userDataSyncMachines","vs/nls!vs/platform/userDataSync/common/userDataSyncResourceProvider","vs/nls!vs/platform/workspace/common/workspace","vs/platform/contextkey/common/scanner","vs/platform/environment/common/environmentService","vs/platform/environment/node/userDataPath","vs/platform/environment/node/environmentService","vs/platform/extensionManagement/common/extensionNls","vs/platform/extensionRecommendations/common/extensionRecommendationsIpc","vs/platform/instantiation/common/extensions","vs/platform/instantiation/common/graph","vs/platform/checksum/common/checksumService","vs/platform/extensionManagement/common/extensionManagementIpc","vs/platform/checksum/node/checksumService","vs/platform/files/common/diskFileSystemProviderClient","vs/platform/files/node/watcher/nodejs/nodejsWatcherLib","vs/platform/files/node/watcher/nodejs/nodejsWatcher","vs/platform/files/node/watcher/nodejs/nodejsClient","vs/platform/files/node/watcher/watcherClient","vs/platform/instantiation/common/instantiationService","vs/code/node/sharedProcess/contrib/localizationsUpdater","vs/code/node/sharedProcess/contrib/logsDataCleaner","vs/platform/files/common/diskFileSystemProvider","vs/platform/files/common/fileService","vs/platform/files/node/diskFileSystemProvider","vs/platform/log/common/logIpc","vs/platform/log/common/logService","vs/platform/policy/common/policyIpc","vs/code/node/sharedProcess/contrib/codeCacheCleaner","vs/code/node/sharedProcess/contrib/languagePackCachedDataCleaner","vs/platform/profiling/common/profiling","vs/platform/profiling/node/profilingService","vs/platform/configuration/common/configurations","vs/platform/configuration/common/configurationService","vs/platform/remote/common/managedSocket","vs/platform/remote/common/remoteAuthorityResolver","vs/platform/extensionManagement/node/extensionsManifestCache","vs/platform/remote/common/remoteAgentConnection","vs/platform/remote/common/sharedProcessTunnelService","vs/platform/download/common/downloadService","vs/platform/request/common/requestIpc","vs/platform/sharedProcess/common/sharedProcess","vs/platform/sign/common/abstractSignService","vs/platform/sign/node/signService","vs/platform/diagnostics/node/diagnosticsService","vs/platform/extensionManagement/common/extensionTipsService","vs/platform/extensionManagement/common/unsupportedExtensionsMigration","vs/platform/extensionManagement/node/extensionsWatcher","vs/platform/externalServices/common/marketplace","vs/platform/languagePacks/node/languagePacks","vs/platform/telemetry/common/1dsAppender","vs/platform/telemetry/node/1dsAppender","vs/platform/telemetry/node/customEndpointTelemetryService","vs/platform/tunnel/node/sharedProcessTunnelService","vs/platform/uriIdentity/common/uriIdentityService","vs/platform/userData/common/fileUserDataProvider","vs/platform/userDataSync/common/extensionsMerge","vs/platform/userDataSync/common/keybindingsMerge","vs/platform/userDataSync/common/snippetsMerge","vs/platform/userDataSync/common/userDataProfilesManifestMerge","vs/platform/userDataSync/common/globalStateMerge","vs/platform/userDataSync/common/settingsMerge","vs/platform/userDataSync/common/userDataSyncIpc","vs/platform/userDataSync/common/userDataSyncLog","vs/code/node/sharedProcess/contrib/voiceTranscriber","vs/platform/windows/node/windowTracker","vs/code/node/sharedProcess/contrib/userDataProfilesCleaner","vs/platform/extensionManagement/common/abstractExtensionManagementService","vs/platform/extensionManagement/node/extensionLifecycle","vs/platform/extensionManagement/node/extensionsProfileScannerService","vs/platform/extensionManagement/node/extensionsScannerService","vs/platform/extensionManagement/common/extensionGalleryService","vs/platform/extensionManagement/node/extensionTipsService","vs/platform/remoteTunnel/node/remoteTunnelService","vs/platform/storage/common/storageService","vs/platform/userDataProfile/common/userDataProfileIpc","vs/platform/userDataProfile/node/userDataProfileStorageService","vs/platform/userDataSync/common/userDataSyncBackupStoreService","vs/platform/userDataSync/common/userDataSyncEnablementService","vs/platform/userDataSync/common/userDataAutoSyncService","vs/platform/userDataSync/common/userDataSyncResourceProvider","vs/platform/userDataSync/common/userDataSyncService","vs/platform/userDataSync/common/userDataSyncServiceIpc","vs/platform/userDataSync/common/userDataSyncStoreService","vs/platform/userDataSync/node/userDataAutoSyncService","vs/platform/workspaces/node/workspaces","vs/code/node/sharedProcess/contrib/storageDataCleaner","vs/platform/extensionManagement/node/extensionDownloader","vs/platform/extensionManagement/node/extensionManagementUtil","vs/code/node/sharedProcess/contrib/extensions","vs/platform/remote/node/nodeSocketFactory","vs/platform/tunnel/node/tunnelService","stream","util","path","graceful-fs","https","yauzl","yazl","zlib","vs/code/node/sharedProcess/sharedProcessMain"],le=function(te){for(var e=[],I=0,O=te.length;I<O;I++)e[I]=ce[te[I]];return e};define(ce[125],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LoaderStats=e.isESM=void 0,e.isESM=!1;class I{static get(){const A=new Map,_=new Map,k=new Map,D=new Map;function b(h,f){h.has(f.detail)||h.set(f.detail,-f.timestamp)}function S(h,f){const w=h.get(f.detail);w&&(w>=0||h.set(f.detail,w+f.timestamp))}let P=[];typeof te=="function"&&typeof te.getStats=="function"&&(P=te.getStats().slice(0).sort((h,f)=>h.timestamp-f.timestamp));for(const h of P)switch(h.type){case 10:b(A,h);break;case 11:case 12:S(A,h);break;case 21:b(_,h);break;case 22:S(_,h);break;case 33:b(k,h);break;case 34:S(k,h);break;case 31:b(D,h);break;case 32:S(D,h);break}let p=0;k.forEach(h=>p+=h);function g(h){const f=[];return h.forEach((w,l)=>f.push([l,w])),f}return{amdLoad:g(A),amdInvoke:g(_),nodeRequire:g(k),nodeEval:g(D),nodeRequireTotal:p}}static toMarkdownTable(A,_){let k="";const D=[];return A.forEach((b,S)=>{D[S]=b.length}),_.forEach(b=>{b.forEach((S,P)=>{typeof S>"u"&&(S=b[P]="-");const p=S.toString().length;D[P]=Math.max(p,D[P])})}),A.forEach((b,S)=>{k+=`| ${b+" ".repeat(D[S]-b.toString().length)} `}),k+=`|
`,A.forEach((b,S)=>{k+=`| ${"-".repeat(D[S])} `}),k+=`|
`,_.forEach(b=>{b.forEach((S,P)=>{typeof S<"u"&&(k+=`| ${S+" ".repeat(D[P]-S.toString().length)} `)}),k+=`|
`}),k}}e.LoaderStats=I}),define(ce[83],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.throttle=e.debounce=e.memoize=void 0;function I(k){return(D,b,S)=>{let P=null,p=null;if(typeof S.value=="function"?(P="value",p=S.value):typeof S.get=="function"&&(P="get",p=S.get),!p)throw new Error("not supported");S[P]=k(p,b)}}function O(k,D,b){let S=null,P=null;if(typeof b.value=="function"?(S="value",P=b.value,P.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof b.get=="function"&&(S="get",P=b.get),!P)throw new Error("not supported");const p=`$memoize$${D}`;b[S]=function(...g){return this.hasOwnProperty(p)||Object.defineProperty(this,p,{configurable:!1,enumerable:!1,writable:!1,value:P.apply(this,g)}),this[p]}}e.memoize=O;function A(k,D,b){return I((S,P)=>{const p=`$debounce$${P}`,g=`$debounce$result$${P}`;return function(...h){this[g]||(this[g]=b?b():void 0),clearTimeout(this[p]),D&&(this[g]=D(this[g],...h),h=[this[g]]),this[p]=setTimeout(()=>{S.apply(this,h),this[g]=b?b():void 0},k)}})}e.debounce=A;function _(k,D,b){return I((S,P)=>{const p=`$throttle$timer$${P}`,g=`$throttle$result$${P}`,h=`$throttle$lastRun$${P}`,f=`$throttle$pending$${P}`;return function(...w){if(this[g]||(this[g]=b?b():void 0),(this[h]===null||this[h]===void 0)&&(this[h]=-Number.MAX_VALUE),D&&(this[g]=D(this[g],...w)),this[f])return;const l=this[h]+k;l<=Date.now()?(this[h]=Date.now(),S.apply(this,[this[g]]),this[g]=b?b():void 0):(this[f]=!0,this[p]=setTimeout(()=>{this[f]=!1,this[h]=Date.now(),S.apply(this,[this[g]]),this[g]=b?b():void 0},l-Date.now()))}})}e.throttle=_}),define(ce[8],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BugIndicatingError=e.ErrorNoTelemetry=e.ExpectedError=e.NotSupportedError=e.NotImplementedError=e.getErrorMessage=e.disposed=e.readonly=e.illegalState=e.illegalArgument=e.canceled=e.CancellationError=e.isCancellationError=e.transformErrorForSerialization=e.onUnexpectedExternalError=e.onUnexpectedError=e.isSigPipeError=e.setUnexpectedErrorHandler=e.errorHandler=e.ErrorHandler=void 0;class I{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(o){setTimeout(()=>{throw o.stack?y.isErrorNoTelemetry(o)?new y(o.message+`

`+o.stack):new Error(o.message+`

`+o.stack):o},0)}}addListener(o){return this.listeners.push(o),()=>{this._removeListener(o)}}emit(o){this.listeners.forEach(n=>{n(o)})}_removeListener(o){this.listeners.splice(this.listeners.indexOf(o),1)}setUnexpectedErrorHandler(o){this.unexpectedErrorHandler=o}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(o){this.unexpectedErrorHandler(o),this.emit(o)}onUnexpectedExternalError(o){this.unexpectedErrorHandler(o)}}e.ErrorHandler=I,e.errorHandler=new I;function O(t){e.errorHandler.setUnexpectedErrorHandler(t)}e.setUnexpectedErrorHandler=O;function A(t){if(!t||typeof t!="object")return!1;const o=t;return o.code==="EPIPE"&&o.syscall?.toUpperCase()==="WRITE"}e.isSigPipeError=A;function _(t){S(t)||e.errorHandler.onUnexpectedError(t)}e.onUnexpectedError=_;function k(t){S(t)||e.errorHandler.onUnexpectedExternalError(t)}e.onUnexpectedExternalError=k;function D(t){if(t instanceof Error){const{name:o,message:n}=t;let s=t.errorCode;const i=t.stacktrace||t.stack;return{$isError:!0,name:o,message:n,stack:i,errorCode:s,data:t.data}}return t}e.transformErrorForSerialization=D;const b="Canceled";function S(t){return t instanceof P?!0:t instanceof Error&&t.name===b&&t.message===b}e.isCancellationError=S;class P extends Error{constructor(){super(b),this.name=this.message}}e.CancellationError=P;function p(){const t=new Error(b);return t.name=t.message,t}e.canceled=p;function g(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}e.illegalArgument=g;function h(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}e.illegalState=h;function f(t){return t?new Error(`readonly property '${t} cannot be changed'`):new Error("readonly property cannot be changed")}e.readonly=f;function w(t){const o=new Error(`${t} has been disposed`);return o.name="DISPOSED",o}e.disposed=w;function l(t){return t?t.message?t.message:t.stack?t.stack.split(`
`)[0]:String(t):"Error"}e.getErrorMessage=l;class d extends Error{constructor(o){super("NotImplemented"),o&&(this.message=o)}}e.NotImplementedError=d;class c extends Error{constructor(o){super("NotSupported"),o&&(this.message=o)}}e.NotSupportedError=c;class m extends Error{constructor(){super(...arguments),this.isExpected=!0}}e.ExpectedError=m;class y extends Error{constructor(o){super(o),this.name="CodeExpectedError"}static fromError(o){if(o instanceof y)return o;const n=new y;return n.message=o.message,n.stack=o.stack,n}static isErrorNoTelemetry(o){return o.name==="CodeExpectedError"}}e.ErrorNoTelemetry=y;class T extends Error{constructor(o){super(o||"An unexpected bug occurred."),Object.setPrototypeOf(this,T.prototype)}}e.BugIndicatingError=T}),define(ce[20],le([0,1,8]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CallbackIterable=e.ArrayQueue=e.findMaxIdxBy=e.findMinBy=e.findLastMaxBy=e.findMaxBy=e.reverseOrder=e.booleanComparator=e.numberComparator=e.tieBreakComparators=e.compareBy=e.CompareResult=e.splice=e.insertInto=e.mapFind=e.getRandomElement=e.asArray=e.mapArrayOrNot=e.pushMany=e.pushToEnd=e.pushToStart=e.shuffle=e.arrayInsert=e.remove=e.insert=e.index=e.range=e.flatten=e.commonPrefixLength=e.lastOrDefault=e.firstOrDefault=e.findLastIndex=e.findLast=e.uniqueFilter=e.distinct=e.isNonEmptyArray=e.isFalsyOrEmpty=e.move=e.coalesceInPlace=e.coalesce=e.topAsync=e.top=e.delta=e.sortedDiff=e.groupBy=e.quickSelect=e.findFirstInSorted=e.binarySearch2=e.binarySearch=e.removeFastWithoutKeepingOrder=e.equals=e.tail2=e.tail=void 0;function O(Q,ee=0){return Q[Q.length-(1+ee)]}e.tail=O;function A(Q){if(Q.length===0)throw new Error("Invalid tail call");return[Q.slice(0,Q.length-1),Q[Q.length-1]]}e.tail2=A;function _(Q,ee,ie=(de,fe)=>de===fe){if(Q===ee)return!0;if(!Q||!ee||Q.length!==ee.length)return!1;for(let de=0,fe=Q.length;de<fe;de++)if(!ie(Q[de],ee[de]))return!1;return!0}e.equals=_;function k(Q,ee){const ie=Q.length-1;ee<ie&&(Q[ee]=Q[ie]),Q.pop()}e.removeFastWithoutKeepingOrder=k;function D(Q,ee,ie){return b(Q.length,de=>ie(Q[de],ee))}e.binarySearch=D;function b(Q,ee){let ie=0,de=Q-1;for(;ie<=de;){const fe=(ie+de)/2|0,pe=ee(fe);if(pe<0)ie=fe+1;else if(pe>0)de=fe-1;else return fe}return-(ie+1)}e.binarySearch2=b;function S(Q,ee){let ie=0,de=Q.length;if(de===0)return 0;for(;ie<de;){const fe=Math.floor((ie+de)/2);ee(Q[fe])?de=fe:ie=fe+1}return ie}e.findFirstInSorted=S;function P(Q,ee,ie){if(Q=Q|0,Q>=ee.length)throw new TypeError("invalid index");const de=ee[Math.floor(ee.length*Math.random())],fe=[],pe=[],ye=[];for(const De of ee){const ke=ie(De,de);ke<0?fe.push(De):ke>0?pe.push(De):ye.push(De)}return Q<fe.length?P(Q,fe,ie):Q<fe.length+ye.length?ye[0]:P(Q-(fe.length+ye.length),pe,ie)}e.quickSelect=P;function p(Q,ee){const ie=[];let de;for(const fe of Q.slice(0).sort(ee))!de||ee(de[0],fe)!==0?(de=[fe],ie.push(de)):de.push(fe);return ie}e.groupBy=p;function g(Q,ee,ie){const de=[];function fe(De,ke,Ue){if(ke===0&&Ue.length===0)return;const he=de[de.length-1];he&&he.start+he.deleteCount===De?(he.deleteCount+=ke,he.toInsert.push(...Ue)):de.push({start:De,deleteCount:ke,toInsert:Ue})}let pe=0,ye=0;for(;;){if(pe===Q.length){fe(pe,0,ee.slice(ye));break}if(ye===ee.length){fe(pe,Q.length-pe,[]);break}const De=Q[pe],ke=ee[ye],Ue=ie(De,ke);Ue===0?(pe+=1,ye+=1):Ue<0?(fe(pe,1,[]),pe+=1):Ue>0&&(fe(pe,0,[ke]),ye+=1)}return de}e.sortedDiff=g;function h(Q,ee,ie){const de=g(Q,ee,ie),fe=[],pe=[];for(const ye of de)fe.push(...Q.slice(ye.start,ye.start+ye.deleteCount)),pe.push(...ye.toInsert);return{removed:fe,added:pe}}e.delta=h;function f(Q,ee,ie){if(ie===0)return[];const de=Q.slice(0,ie).sort(ee);return l(Q,ee,de,ie,Q.length),de}e.top=f;function w(Q,ee,ie,de,fe){return ie===0?Promise.resolve([]):new Promise((pe,ye)=>{(async()=>{const De=Q.length,ke=Q.slice(0,ie).sort(ee);for(let Ue=ie,he=Math.min(ie+de,De);Ue<De;Ue=he,he=Math.min(he+de,De)){if(Ue>ie&&await new Promise(me=>setTimeout(me)),fe&&fe.isCancellationRequested)throw new I.CancellationError;l(Q,ee,ke,Ue,he)}return ke})().then(pe,ye)})}e.topAsync=w;function l(Q,ee,ie,de,fe){for(const pe=ie.length;de<fe;de++){const ye=Q[de];if(ee(ye,ie[pe-1])<0){ie.pop();const De=S(ie,ke=>ee(ye,ke)<0);ie.splice(De,0,ye)}}}function d(Q){return Q.filter(ee=>!!ee)}e.coalesce=d;function c(Q){let ee=0;for(let ie=0;ie<Q.length;ie++)Q[ie]&&(Q[ee]=Q[ie],ee+=1);Q.length=ee}e.coalesceInPlace=c;function m(Q,ee,ie){Q.splice(ie,0,Q.splice(ee,1)[0])}e.move=m;function y(Q){return!Array.isArray(Q)||Q.length===0}e.isFalsyOrEmpty=y;function T(Q){return Array.isArray(Q)&&Q.length>0}e.isNonEmptyArray=T;function t(Q,ee=ie=>ie){const ie=new Set;return Q.filter(de=>{const fe=ee(de);return ie.has(fe)?!1:(ie.add(fe),!0)})}e.distinct=t;function o(Q){const ee=new Set;return ie=>{const de=Q(ie);return ee.has(de)?!1:(ee.add(de),!0)}}e.uniqueFilter=o;function n(Q,ee){const ie=s(Q,ee);if(ie!==-1)return Q[ie]}e.findLast=n;function s(Q,ee){for(let ie=Q.length-1;ie>=0;ie--){const de=Q[ie];if(ee(de))return ie}return-1}e.findLastIndex=s;function i(Q,ee){return Q.length>0?Q[0]:ee}e.firstOrDefault=i;function r(Q,ee){return Q.length>0?Q[Q.length-1]:ee}e.lastOrDefault=r;function a(Q,ee,ie=(de,fe)=>de===fe){let de=0;for(let fe=0,pe=Math.min(Q.length,ee.length);fe<pe&&ie(Q[fe],ee[fe]);fe++)de++;return de}e.commonPrefixLength=a;function E(Q){return[].concat(...Q)}e.flatten=E;function v(Q,ee){let ie=typeof ee=="number"?Q:0;typeof ee=="number"?ie=Q:(ie=0,ee=Q);const de=[];if(ie<=ee)for(let fe=ie;fe<ee;fe++)de.push(fe);else for(let fe=ie;fe>ee;fe--)de.push(fe);return de}e.range=v;function u(Q,ee,ie){return Q.reduce((de,fe)=>(de[ee(fe)]=ie?ie(fe):fe,de),Object.create(null))}e.index=u;function C(Q,ee){return Q.push(ee),()=>U(Q,ee)}e.insert=C;function U(Q,ee){const ie=Q.indexOf(ee);if(ie>-1)return Q.splice(ie,1),ee}e.remove=U;function F(Q,ee,ie){const de=Q.slice(0,ee),fe=Q.slice(ee);return de.concat(ie,fe)}e.arrayInsert=F;function M(Q,ee){let ie;if(typeof ee=="number"){let de=ee;ie=()=>{const fe=Math.sin(de++)*179426549;return fe-Math.floor(fe)}}else ie=Math.random;for(let de=Q.length-1;de>0;de-=1){const fe=Math.floor(ie()*(de+1)),pe=Q[de];Q[de]=Q[fe],Q[fe]=pe}}e.shuffle=M;function z(Q,ee){const ie=Q.indexOf(ee);ie>-1&&(Q.splice(ie,1),Q.unshift(ee))}e.pushToStart=z;function V(Q,ee){const ie=Q.indexOf(ee);ie>-1&&(Q.splice(ie,1),Q.push(ee))}e.pushToEnd=V;function J(Q,ee){for(const ie of ee)Q.push(ie)}e.pushMany=J;function H(Q,ee){return Array.isArray(Q)?Q.map(ee):ee(Q)}e.mapArrayOrNot=H;function Y(Q){return Array.isArray(Q)?Q:[Q]}e.asArray=Y;function B(Q){return Q[Math.floor(Math.random()*Q.length)]}e.getRandomElement=B;function K(Q,ee){for(const ie of Q){const de=ee(ie);if(de!==void 0)return de}}e.mapFind=K;function x(Q,ee,ie){const de=j(Q,ee),fe=Q.length,pe=ie.length;Q.length=fe+pe;for(let ye=fe-1;ye>=de;ye--)Q[ye+pe]=Q[ye];for(let ye=0;ye<pe;ye++)Q[ye+de]=ie[ye]}e.insertInto=x;function q(Q,ee,ie,de){const fe=j(Q,ee),pe=Q.splice(fe,ie);return x(Q,fe,de),pe}e.splice=q;function j(Q,ee){return ee<0?Math.max(ee+Q.length,0):Math.min(ee,Q.length)}var Z;(function(Q){function ee(pe){return pe<0}Q.isLessThan=ee;function ie(pe){return pe<=0}Q.isLessThanOrEqual=ie;function de(pe){return pe>0}Q.isGreaterThan=de;function fe(pe){return pe===0}Q.isNeitherLessOrGreaterThan=fe,Q.greaterThan=1,Q.lessThan=-1,Q.neitherLessOrGreaterThan=0})(Z||(e.CompareResult=Z={}));function oe(Q,ee){return(ie,de)=>ee(Q(ie),Q(de))}e.compareBy=oe;function ue(...Q){return(ee,ie)=>{for(const de of Q){const fe=de(ee,ie);if(!Z.isNeitherLessOrGreaterThan(fe))return fe}return Z.neitherLessOrGreaterThan}}e.tieBreakComparators=ue;const ae=(Q,ee)=>Q-ee;e.numberComparator=ae;const $=(Q,ee)=>(0,e.numberComparator)(Q?1:0,ee?1:0);e.booleanComparator=$;function R(Q){return(ee,ie)=>-Q(ee,ie)}e.reverseOrder=R;function L(Q,ee){if(Q.length===0)return;let ie=Q[0];for(let de=1;de<Q.length;de++){const fe=Q[de];ee(fe,ie)>0&&(ie=fe)}return ie}e.findMaxBy=L;function N(Q,ee){if(Q.length===0)return;let ie=Q[0];for(let de=1;de<Q.length;de++){const fe=Q[de];ee(fe,ie)>=0&&(ie=fe)}return ie}e.findLastMaxBy=N;function W(Q,ee){return L(Q,(ie,de)=>-ee(ie,de))}e.findMinBy=W;function X(Q,ee){if(Q.length===0)return-1;let ie=0;for(let de=1;de<Q.length;de++){const fe=Q[de];ee(fe,Q[ie])>0&&(ie=de)}return ie}e.findMaxIdxBy=X;class ne{constructor(ee){this.items=ee,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(ee){let ie=this.firstIdx;for(;ie<this.items.length&&ee(this.items[ie]);)ie++;const de=ie===this.firstIdx?null:this.items.slice(this.firstIdx,ie);return this.firstIdx=ie,de}takeFromEndWhile(ee){let ie=this.lastIdx;for(;ie>=0&&ee(this.items[ie]);)ie--;const de=ie===this.lastIdx?null:this.items.slice(ie+1,this.lastIdx+1);return this.lastIdx=ie,de}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){const ee=this.items[this.firstIdx];return this.firstIdx++,ee}removeLast(){const ee=this.items[this.lastIdx];return this.lastIdx--,ee}takeCount(ee){const ie=this.items.slice(this.firstIdx,this.firstIdx+ee);return this.firstIdx+=ee,ie}}e.ArrayQueue=ne;class re{static{this.empty=new re(ee=>{})}constructor(ee){this.iterate=ee}forEach(ee){this.iterate(ie=>(ee(ie),!0))}toArray(){const ee=[];return this.iterate(ie=>(ee.push(ie),!0)),ee}filter(ee){return new re(ie=>this.iterate(de=>ee(de)?ie(de):!0))}map(ee){return new re(ie=>this.iterate(de=>ie(ee(de))))}some(ee){let ie=!1;return this.iterate(de=>(ie=ee(de),!ie)),ie}findFirst(ee){let ie;return this.iterate(de=>ee(de)?(ie=de,!1):!0),ie}findLast(ee){let ie;return this.iterate(de=>(ee(de)&&(ie=de),!0)),ie}findLastMaxBy(ee){let ie,de=!0;return this.iterate(fe=>((de||Z.isGreaterThan(ee(fe,ie)))&&(de=!1,ie=fe),!0)),ie}}e.CallbackIterable=re}),define(ce[126],le([0,1,8]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkAdjacentItems=e.assertFn=e.assert=e.assertNever=e.ok=void 0;function O(b,S){if(!b)throw new Error(S?`Assertion failed (${S})`:"Assertion Failed")}e.ok=O;function A(b,S="Unreachable"){throw new Error(S)}e.assertNever=A;function _(b){if(!b)throw new I.BugIndicatingError("Assertion Failed")}e.assert=_;function k(b){if(!b()){debugger;b(),(0,I.onUnexpectedError)(new I.BugIndicatingError("Assertion Failed"))}}e.assertFn=k;function D(b,S){let P=0;for(;P<b.length-1;){const p=b[P],g=b[P+1];if(!S(p,g))return!1;P++}return!0}e.checkAdjacentItems=D}),define(ce[84],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.once=void 0;function I(O){const A=this;let _=!1,k;return function(){return _||(_=!0,k=O.apply(A,arguments)),k}}e.once=I}),define(ce[59],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Iterable=void 0;var I;(function(O){function A(y){return y&&typeof y=="object"&&typeof y[Symbol.iterator]=="function"}O.is=A;const _=Object.freeze([]);function k(){return _}O.empty=k;function*D(y){yield y}O.single=D;function b(y){return A(y)?y:D(y)}O.wrap=b;function S(y){return y||_}O.from=S;function P(y){return!y||y[Symbol.iterator]().next().done===!0}O.isEmpty=P;function p(y){return y[Symbol.iterator]().next().value}O.first=p;function g(y,T){for(const t of y)if(T(t))return!0;return!1}O.some=g;function h(y,T){for(const t of y)if(T(t))return t}O.find=h;function*f(y,T){for(const t of y)T(t)&&(yield t)}O.filter=f;function*w(y,T){let t=0;for(const o of y)yield T(o,t++)}O.map=w;function*l(...y){for(const T of y)for(const t of T)yield t}O.concat=l;function d(y,T,t){let o=t;for(const n of y)o=T(o,n);return o}O.reduce=d;function*c(y,T,t=y.length){for(T<0&&(T+=y.length),t<0?t+=y.length:t>y.length&&(t=y.length);T<t;T++)yield y[T]}O.slice=c;function m(y,T=Number.POSITIVE_INFINITY){const t=[];if(T===0)return[t,y];const o=y[Symbol.iterator]();for(let n=0;n<T;n++){const s=o.next();if(s.done)return[t,O.empty()];t.push(s.value)}return[t,{[Symbol.iterator](){return o}}]}O.consume=m})(I||(e.Iterable=I={}))}),define(ce[34],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getNodeType=e.stripComments=e.visit=e.findNodeAtOffset=e.contains=e.getNodeValue=e.getNodePath=e.findNodeAtLocation=e.parseTree=e.parse=e.getLocation=e.createScanner=e.ParseOptions=e.ParseErrorCode=e.SyntaxKind=e.ScanError=void 0;var I;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(I||(e.ScanError=I={}));var O;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(O||(e.SyntaxKind=O={}));var A;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(A||(e.ParseErrorCode=A={}));var _;(function(t){t.DEFAULT={allowTrailingComma:!0}})(_||(e.ParseOptions=_={}));function k(t,o=!1){let n=0;const s=t.length;let i="",r=0,a=16,E=0;function v(V){let J=0,H=0;for(;J<V;){const Y=t.charCodeAt(n);if(Y>=48&&Y<=57)H=H*16+Y-48;else if(Y>=65&&Y<=70)H=H*16+Y-65+10;else if(Y>=97&&Y<=102)H=H*16+Y-97+10;else break;n++,J++}return J<V&&(H=-1),H}function u(V){n=V,i="",r=0,a=16,E=0}function C(){const V=n;if(t.charCodeAt(n)===48)n++;else for(n++;n<t.length&&S(t.charCodeAt(n));)n++;if(n<t.length&&t.charCodeAt(n)===46)if(n++,n<t.length&&S(t.charCodeAt(n)))for(n++;n<t.length&&S(t.charCodeAt(n));)n++;else return E=3,t.substring(V,n);let J=n;if(n<t.length&&(t.charCodeAt(n)===69||t.charCodeAt(n)===101))if(n++,(n<t.length&&t.charCodeAt(n)===43||t.charCodeAt(n)===45)&&n++,n<t.length&&S(t.charCodeAt(n))){for(n++;n<t.length&&S(t.charCodeAt(n));)n++;J=n}else E=3;return t.substring(V,J)}function U(){let V="",J=n;for(;;){if(n>=s){V+=t.substring(J,n),E=2;break}const H=t.charCodeAt(n);if(H===34){V+=t.substring(J,n),n++;break}if(H===92){if(V+=t.substring(J,n),n++,n>=s){E=2;break}switch(t.charCodeAt(n++)){case 34:V+='"';break;case 92:V+="\\";break;case 47:V+="/";break;case 98:V+="\b";break;case 102:V+="\f";break;case 110:V+=`
`;break;case 114:V+="\r";break;case 116:V+="	";break;case 117:{const B=v(4);B>=0?V+=String.fromCharCode(B):E=4;break}default:E=5}J=n;continue}if(H>=0&&H<=31)if(b(H)){V+=t.substring(J,n),E=2;break}else E=6;n++}return V}function F(){if(i="",E=0,r=n,n>=s)return r=s,a=17;let V=t.charCodeAt(n);if(D(V)){do n++,i+=String.fromCharCode(V),V=t.charCodeAt(n);while(D(V));return a=15}if(b(V))return n++,i+=String.fromCharCode(V),V===13&&t.charCodeAt(n)===10&&(n++,i+=`
`),a=14;switch(V){case 123:return n++,a=1;case 125:return n++,a=2;case 91:return n++,a=3;case 93:return n++,a=4;case 58:return n++,a=6;case 44:return n++,a=5;case 34:return n++,i=U(),a=10;case 47:{const J=n-1;if(t.charCodeAt(n+1)===47){for(n+=2;n<s&&!b(t.charCodeAt(n));)n++;return i=t.substring(J,n),a=12}if(t.charCodeAt(n+1)===42){n+=2;const H=s-1;let Y=!1;for(;n<H;){if(t.charCodeAt(n)===42&&t.charCodeAt(n+1)===47){n+=2,Y=!0;break}n++}return Y||(n++,E=1),i=t.substring(J,n),a=13}return i+=String.fromCharCode(V),n++,a=16}case 45:if(i+=String.fromCharCode(V),n++,n===s||!S(t.charCodeAt(n)))return a=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=C(),a=11;default:for(;n<s&&M(V);)n++,V=t.charCodeAt(n);if(r!==n){switch(i=t.substring(r,n),i){case"true":return a=8;case"false":return a=9;case"null":return a=7}return a=16}return i+=String.fromCharCode(V),n++,a=16}}function M(V){if(D(V)||b(V))return!1;switch(V){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function z(){let V;do V=F();while(V>=12&&V<=15);return V}return{setPosition:u,getPosition:()=>n,scan:o?z:F,getToken:()=>a,getTokenValue:()=>i,getTokenOffset:()=>r,getTokenLength:()=>n-r,getTokenError:()=>E}}e.createScanner=k;function D(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function b(t){return t===10||t===13||t===8232||t===8233}function S(t){return t>=48&&t<=57}var P;(function(t){t[t.nullCharacter=0]="nullCharacter",t[t.maxAsciiCharacter=127]="maxAsciiCharacter",t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.lineSeparator=8232]="lineSeparator",t[t.paragraphSeparator=8233]="paragraphSeparator",t[t.nextLine=133]="nextLine",t[t.space=32]="space",t[t.nonBreakingSpace=160]="nonBreakingSpace",t[t.enQuad=8192]="enQuad",t[t.emQuad=8193]="emQuad",t[t.enSpace=8194]="enSpace",t[t.emSpace=8195]="emSpace",t[t.threePerEmSpace=8196]="threePerEmSpace",t[t.fourPerEmSpace=8197]="fourPerEmSpace",t[t.sixPerEmSpace=8198]="sixPerEmSpace",t[t.figureSpace=8199]="figureSpace",t[t.punctuationSpace=8200]="punctuationSpace",t[t.thinSpace=8201]="thinSpace",t[t.hairSpace=8202]="hairSpace",t[t.zeroWidthSpace=8203]="zeroWidthSpace",t[t.narrowNoBreakSpace=8239]="narrowNoBreakSpace",t[t.ideographicSpace=12288]="ideographicSpace",t[t.mathematicalSpace=8287]="mathematicalSpace",t[t.ogham=5760]="ogham",t[t._=95]="_",t[t.$=36]="$",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.ampersand=38]="ampersand",t[t.asterisk=42]="asterisk",t[t.at=64]="at",t[t.backslash=92]="backslash",t[t.bar=124]="bar",t[t.caret=94]="caret",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.closeParen=41]="closeParen",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.equals=61]="equals",t[t.exclamation=33]="exclamation",t[t.greaterThan=62]="greaterThan",t[t.lessThan=60]="lessThan",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.openParen=40]="openParen",t[t.percent=37]="percent",t[t.plus=43]="plus",t[t.question=63]="question",t[t.semicolon=59]="semicolon",t[t.singleQuote=39]="singleQuote",t[t.slash=47]="slash",t[t.tilde=126]="tilde",t[t.backspace=8]="backspace",t[t.formFeed=12]="formFeed",t[t.byteOrderMark=65279]="byteOrderMark",t[t.tab=9]="tab",t[t.verticalTab=11]="verticalTab"})(P||(P={}));function p(t,o){const n=[],s=new Object;let i;const r={value:{},offset:0,length:0,type:"object",parent:void 0};let a=!1;function E(v,u,C,U){r.value=v,r.offset=u,r.length=C,r.type=U,r.colonOffset=void 0,i=r}try{m(t,{onObjectBegin:(v,u)=>{if(o<=v)throw s;i=void 0,a=o>v,n.push("")},onObjectProperty:(v,u,C)=>{if(o<u||(E(v,u,C,"property"),n[n.length-1]=v,o<=u+C))throw s},onObjectEnd:(v,u)=>{if(o<=v)throw s;i=void 0,n.pop()},onArrayBegin:(v,u)=>{if(o<=v)throw s;i=void 0,n.push(0)},onArrayEnd:(v,u)=>{if(o<=v)throw s;i=void 0,n.pop()},onLiteralValue:(v,u,C)=>{if(o<u||(E(v,u,C,T(v)),o<=u+C))throw s},onSeparator:(v,u,C)=>{if(o<=u)throw s;if(v===":"&&i&&i.type==="property")i.colonOffset=u,a=!1,i=void 0;else if(v===","){const U=n[n.length-1];typeof U=="number"?n[n.length-1]=U+1:(a=!0,n[n.length-1]=""),i=void 0}}})}catch(v){if(v!==s)throw v}return{path:n,previousNode:i,isAtPropertyKey:a,matches:v=>{let u=0;for(let C=0;u<v.length&&C<n.length;C++)if(v[u]===n[C]||v[u]==="*")u++;else if(v[u]!=="**")return!1;return u===v.length}}}e.getLocation=p;function g(t,o=[],n=_.DEFAULT){let s=null,i=[];const r=[];function a(v){Array.isArray(i)?i.push(v):s!==null&&(i[s]=v)}return m(t,{onObjectBegin:()=>{const v={};a(v),r.push(i),i=v,s=null},onObjectProperty:v=>{s=v},onObjectEnd:()=>{i=r.pop()},onArrayBegin:()=>{const v=[];a(v),r.push(i),i=v,s=null},onArrayEnd:()=>{i=r.pop()},onLiteralValue:a,onError:(v,u,C)=>{o.push({error:v,offset:u,length:C})}},n),i[0]}e.parse=g;function h(t,o=[],n=_.DEFAULT){let s={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(v){s.type==="property"&&(s.length=v-s.offset,s=s.parent)}function r(v){return s.children.push(v),v}m(t,{onObjectBegin:v=>{s=r({type:"object",offset:v,length:-1,parent:s,children:[]})},onObjectProperty:(v,u,C)=>{s=r({type:"property",offset:u,length:-1,parent:s,children:[]}),s.children.push({type:"string",value:v,offset:u,length:C,parent:s})},onObjectEnd:(v,u)=>{s.length=v+u-s.offset,s=s.parent,i(v+u)},onArrayBegin:(v,u)=>{s=r({type:"array",offset:v,length:-1,parent:s,children:[]})},onArrayEnd:(v,u)=>{s.length=v+u-s.offset,s=s.parent,i(v+u)},onLiteralValue:(v,u,C)=>{r({type:T(v),offset:u,length:C,parent:s,value:v}),i(u+C)},onSeparator:(v,u,C)=>{s.type==="property"&&(v===":"?s.colonOffset=u:v===","&&i(u))},onError:(v,u,C)=>{o.push({error:v,offset:u,length:C})}},n);const E=s.children[0];return E&&delete E.parent,E}e.parseTree=h;function f(t,o){if(!t)return;let n=t;for(const s of o)if(typeof s=="string"){if(n.type!=="object"||!Array.isArray(n.children))return;let i=!1;for(const r of n.children)if(Array.isArray(r.children)&&r.children[0].value===s){n=r.children[1],i=!0;break}if(!i)return}else{const i=s;if(n.type!=="array"||i<0||!Array.isArray(n.children)||i>=n.children.length)return;n=n.children[i]}return n}e.findNodeAtLocation=f;function w(t){if(!t.parent||!t.parent.children)return[];const o=w(t.parent);if(t.parent.type==="property"){const n=t.parent.children[0].value;o.push(n)}else if(t.parent.type==="array"){const n=t.parent.children.indexOf(t);n!==-1&&o.push(n)}return o}e.getNodePath=w;function l(t){switch(t.type){case"array":return t.children.map(l);case"object":{const o=Object.create(null);for(const n of t.children){const s=n.children[1];s&&(o[n.children[0].value]=l(s))}return o}case"null":case"string":case"number":case"boolean":return t.value;default:return}}e.getNodeValue=l;function d(t,o,n=!1){return o>=t.offset&&o<t.offset+t.length||n&&o===t.offset+t.length}e.contains=d;function c(t,o,n=!1){if(d(t,o,n)){const s=t.children;if(Array.isArray(s))for(let i=0;i<s.length&&s[i].offset<=o;i++){const r=c(s[i],o,n);if(r)return r}return t}}e.findNodeAtOffset=c;function m(t,o,n=_.DEFAULT){const s=k(t,!1);function i(oe){return oe?()=>oe(s.getTokenOffset(),s.getTokenLength()):()=>!0}function r(oe){return oe?ue=>oe(ue,s.getTokenOffset(),s.getTokenLength()):()=>!0}const a=i(o.onObjectBegin),E=r(o.onObjectProperty),v=i(o.onObjectEnd),u=i(o.onArrayBegin),C=i(o.onArrayEnd),U=r(o.onLiteralValue),F=r(o.onSeparator),M=i(o.onComment),z=r(o.onError),V=n&&n.disallowComments,J=n&&n.allowTrailingComma;function H(){for(;;){const oe=s.scan();switch(s.getTokenError()){case 4:Y(14);break;case 5:Y(15);break;case 3:Y(13);break;case 1:V||Y(11);break;case 2:Y(12);break;case 6:Y(16);break}switch(oe){case 12:case 13:V?Y(10):M();break;case 16:Y(1);break;case 15:case 14:break;default:return oe}}}function Y(oe,ue=[],ae=[]){if(z(oe),ue.length+ae.length>0){let $=s.getToken();for(;$!==17;){if(ue.indexOf($)!==-1){H();break}else if(ae.indexOf($)!==-1)break;$=H()}}}function B(oe){const ue=s.getTokenValue();return oe?U(ue):E(ue),H(),!0}function K(){switch(s.getToken()){case 11:{let oe=0;try{oe=JSON.parse(s.getTokenValue()),typeof oe!="number"&&(Y(2),oe=0)}catch{Y(2)}U(oe);break}case 7:U(null);break;case 8:U(!0);break;case 9:U(!1);break;default:return!1}return H(),!0}function x(){return s.getToken()!==10?(Y(3,[],[2,5]),!1):(B(!1),s.getToken()===6?(F(":"),H(),Z()||Y(4,[],[2,5])):Y(5,[],[2,5]),!0)}function q(){a(),H();let oe=!1;for(;s.getToken()!==2&&s.getToken()!==17;){if(s.getToken()===5){if(oe||Y(4,[],[]),F(","),H(),s.getToken()===2&&J)break}else oe&&Y(6,[],[]);x()||Y(4,[],[2,5]),oe=!0}return v(),s.getToken()!==2?Y(7,[2],[]):H(),!0}function j(){u(),H();let oe=!1;for(;s.getToken()!==4&&s.getToken()!==17;){if(s.getToken()===5){if(oe||Y(4,[],[]),F(","),H(),s.getToken()===4&&J)break}else oe&&Y(6,[],[]);Z()||Y(4,[],[4,5]),oe=!0}return C(),s.getToken()!==4?Y(8,[4],[]):H(),!0}function Z(){switch(s.getToken()){case 3:return j();case 1:return q();case 10:return B(!0);default:return K()}}return H(),s.getToken()===17?n.allowEmptyContent?!0:(Y(4,[],[]),!1):Z()?(s.getToken()!==17&&Y(9,[],[]),!0):(Y(4,[],[]),!1)}e.visit=m;function y(t,o){const n=k(t),s=[];let i,r=0,a;do switch(a=n.getPosition(),i=n.scan(),i){case 12:case 13:case 17:r!==a&&s.push(t.substring(r,a)),o!==void 0&&s.push(n.getTokenValue().replace(/[^\r\n]/g,o)),r=n.getPosition();break}while(i!==17);return s.join("")}e.stripComments=y;function T(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}e.getNodeType=T}),define(ce[42],le([0,1,34]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isEOL=e.getEOL=e.toFormattedString=e.format=void 0;function O(S,P,p){let g,h,f,w,l;if(P){for(w=P.offset,l=w+P.length,f=w;f>0&&!b(S,f-1);)f--;let a=l;for(;a<S.length&&!b(S,a);)a++;h=S.substring(f,a),g=k(h,p)}else h=S,g=0,f=0,w=0,l=S.length;const d=D(p,S);let c=!1,m=0,y;p.insertSpaces?y=_(" ",p.tabSize||4):y="	";const T=(0,I.createScanner)(h,!1);let t=!1;function o(){return d+_(y,g+m)}function n(){let a=T.scan();for(c=!1;a===15||a===14;)c=c||a===14,a=T.scan();return t=a===16||T.getTokenError()!==0,a}const s=[];function i(a,E,v){!t&&E<l&&v>w&&S.substring(E,v)!==a&&s.push({offset:E,length:v-E,content:a})}let r=n();if(r!==17){const a=T.getTokenOffset()+f,E=_(y,g);i(E,f,a)}for(;r!==17;){let a=T.getTokenOffset()+T.getTokenLength()+f,E=n(),v="";for(;!c&&(E===12||E===13);){const C=T.getTokenOffset()+f;i(" ",a,C),a=T.getTokenOffset()+T.getTokenLength()+f,v=E===12?o():"",E=n()}if(E===2)r!==1&&(m--,v=o());else if(E===4)r!==3&&(m--,v=o());else{switch(r){case 3:case 1:m++,v=o();break;case 5:case 12:v=o();break;case 13:c?v=o():v=" ";break;case 6:v=" ";break;case 10:if(E===6){v="";break}case 7:case 8:case 9:case 11:case 2:case 4:E===12||E===13?v=" ":E!==5&&E!==17&&(t=!0);break;case 16:t=!0;break}c&&(E===12||E===13)&&(v=o())}const u=T.getTokenOffset()+f;i(v,a,u),r=E}return s}e.format=O;function A(S,P){const p=JSON.stringify(S,void 0,P.insertSpaces?P.tabSize||4:"	");return P.eol!==void 0?p.replace(/\r\n|\r|\n/g,P.eol):p}e.toFormattedString=A;function _(S,P){let p="";for(let g=0;g<P;g++)p+=S;return p}function k(S,P){let p=0,g=0;const h=P.tabSize||4;for(;p<S.length;){const f=S.charAt(p);if(f===" ")g++;else if(f==="	")g+=h;else break;p++}return Math.floor(g/h)}function D(S,P){for(let p=0;p<P.length;p++){const g=P.charAt(p);if(g==="\r")return p+1<P.length&&P.charAt(p+1)===`
`?`\r
`:"\r";if(g===`
`)return`
`}return S&&S.eol||`
`}e.getEOL=D;function b(S,P){return`\r
`.indexOf(S.charAt(P))!==-1}e.isEOL=b}),define(ce[85],le([0,1,34,42]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyEdits=e.applyEdit=e.withFormatting=e.setProperty=e.removeProperty=void 0;function A(S,P,p){return _(S,P,void 0,p)}e.removeProperty=A;function _(S,P,p,g,h){const f=P.slice(),w=[],l=(0,I.parseTree)(S,w);let d,c;for(;f.length>0&&(c=f.pop(),d=(0,I.findNodeAtLocation)(l,f),d===void 0&&p!==void 0);)typeof c=="string"?p={[c]:p}:p=[p];if(d)if(d.type==="object"&&typeof c=="string"&&Array.isArray(d.children)){const m=(0,I.findNodeAtLocation)(d,[c]);if(m!==void 0)if(p===void 0){if(!m.parent)throw new Error("Malformed AST");const y=d.children.indexOf(m.parent);let T,t=m.parent.offset+m.parent.length;if(y>0){const o=d.children[y-1];T=o.offset+o.length}else T=d.offset+1,d.children.length>1&&(t=d.children[1].offset);return k(S,{offset:T,length:t-T,content:""},g)}else return k(S,{offset:m.offset,length:m.length,content:JSON.stringify(p)},g);else{if(p===void 0)return[];const y=`${JSON.stringify(c)}: ${JSON.stringify(p)}`,T=h?h(d.children.map(o=>o.children[0].value)):d.children.length;let t;if(T>0){const o=d.children[T-1];t={offset:o.offset+o.length,length:0,content:","+y}}else d.children.length===0?t={offset:d.offset+1,length:0,content:y}:t={offset:d.offset+1,length:0,content:y+","};return k(S,t,g)}}else if(d.type==="array"&&typeof c=="number"&&Array.isArray(d.children))if(p!==void 0){const m=`${JSON.stringify(p)}`;let y;if(d.children.length===0||c===0)y={offset:d.offset+1,length:0,content:d.children.length===0?m:m+","};else{const T=c===-1||c>d.children.length?d.children.length:c,t=d.children[T-1];y={offset:t.offset+t.length,length:0,content:","+m}}return k(S,y,g)}else{const m=c,y=d.children[m];let T;if(d.children.length===1)T={offset:d.offset+1,length:d.length-2,content:""};else if(d.children.length-1===m){const t=d.children[m-1],o=t.offset+t.length,n=d.offset+d.length;T={offset:o,length:n-2-o,content:""}}else T={offset:y.offset,length:d.children[m+1].offset-y.offset,content:""};return k(S,T,g)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${d.type}`);else{if(p===void 0)throw new Error("Can not delete in empty document");return k(S,{offset:l?l.offset:0,length:l?l.length:0,content:JSON.stringify(p)},g)}}e.setProperty=_;function k(S,P,p){let g=D(S,P),h=P.offset,f=P.offset+P.content.length;if(P.length===0||P.content.length===0){for(;h>0&&!(0,O.isEOL)(g,h-1);)h--;for(;f<g.length&&!(0,O.isEOL)(g,f);)f++}const w=(0,O.format)(g,{offset:h,length:f-h},p);for(let d=w.length-1;d>=0;d--){const c=w[d];g=D(g,c),h=Math.min(h,c.offset),f=Math.max(f,c.offset+c.length),f+=c.content.length-c.length}const l=S.length-(g.length-f)-h;return[{offset:h,length:l,content:g.substring(h,f)}]}e.withFormatting=k;function D(S,P){return S.substring(0,P.offset)+P.content+S.substring(P.offset+P.length)}e.applyEdit=D;function b(S,P){const p=P.slice(0).sort((h,f)=>{const w=h.offset-f.offset;return w===0?h.length-f.length:w});let g=S.length;for(let h=p.length-1;h>=0;h--){const f=p[h];if(f.offset+f.length<=g)S=D(S,f);else throw new Error("Overlapping edit");g=f.offset}return S}e.applyEdits=b}),define(ce[86],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lazy=void 0;class I{constructor(A){this.executor=A,this._didRun=!1}get hasValue(){return this._didRun}get value(){if(!this._didRun)try{this._value=this.executor()}catch(A){this._error=A}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}e.Lazy=I}),define(ce[2],le([0,1,84,59]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DisposableMap=e.disposeOnReturn=e.ImmortalReference=e.AsyncReferenceCollection=e.ReferenceCollection=e.SafeDisposable=e.RefCountedDisposable=e.MutableDisposable=e.Disposable=e.DisposableStore=e.toDisposable=e.combinedDisposable=e.disposeIfDisposable=e.dispose=e.isDisposable=e.markAsSingleton=e.setDisposableTracker=void 0;const A=!1;let _=null;function k(r){_=r}if(e.setDisposableTracker=k,A){const r="__is_disposable_tracked__";k(new class{trackDisposable(a){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{a[r]||console.log(E)},3e3)}setParent(a,E){if(a&&a!==c.None)try{a[r]=!0}catch{}}markAsDisposed(a){if(a&&a!==c.None)try{a[r]=!0}catch{}}markAsSingleton(a){}})}function D(r){return _?.trackDisposable(r),r}function b(r){_?.markAsDisposed(r)}function S(r,a){_?.setParent(r,a)}function P(r,a){if(_)for(const E of r)_.setParent(E,a)}function p(r){return _?.markAsSingleton(r),r}e.markAsSingleton=p;function g(r){return typeof r.dispose=="function"&&r.dispose.length===0}e.isDisposable=g;function h(r){if(O.Iterable.is(r)){const a=[];for(const E of r)if(E)try{E.dispose()}catch(v){a.push(v)}if(a.length===1)throw a[0];if(a.length>1)throw new AggregateError(a,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}e.dispose=h;function f(r){for(const a of r)g(a)&&a.dispose();return[]}e.disposeIfDisposable=f;function w(...r){const a=l(()=>h(r));return P(r,a),a}e.combinedDisposable=w;function l(r){const a=D({dispose:(0,I.once)(()=>{b(a),r()})});return a}e.toDisposable=l;class d{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1,D(this)}dispose(){this._isDisposed||(b(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{h(this._toDispose)}finally{this._toDispose.clear()}}add(a){if(!a)return a;if(a===this)throw new Error("Cannot register a disposable on itself!");return S(a,this),this._isDisposed?d.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(a),a}}e.DisposableStore=d;class c{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new d,D(this),S(this._store,this)}dispose(){b(this),this._store.dispose()}_register(a){if(a===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(a)}}e.Disposable=c;class m{constructor(){this._isDisposed=!1,D(this)}get value(){return this._isDisposed?void 0:this._value}set value(a){this._isDisposed||a===this._value||(this._value?.dispose(),a&&S(a,this),this._value=a)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,b(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){const a=this._value;return this._value=void 0,a&&S(a,null),a}}e.MutableDisposable=m;class y{constructor(a){this._disposable=a,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}e.RefCountedDisposable=y;class T{constructor(){this.dispose=()=>{},this.unset=()=>{},this.isset=()=>!1,D(this)}set(a){let E=a;return this.unset=()=>E=void 0,this.isset=()=>E!==void 0,this.dispose=()=>{E&&(E(),E=void 0,b(this))},this}}e.SafeDisposable=T;class t{constructor(){this.references=new Map}acquire(a,...E){let v=this.references.get(a);v||(v={counter:0,object:this.createReferencedObject(a,...E)},this.references.set(a,v));const{object:u}=v,C=(0,I.once)(()=>{--v.counter===0&&(this.destroyReferencedObject(a,v.object),this.references.delete(a))});return v.counter++,{object:u,dispose:C}}}e.ReferenceCollection=t;class o{constructor(a){this.referenceCollection=a}async acquire(a,...E){const v=this.referenceCollection.acquire(a,...E);try{return{object:await v.object,dispose:()=>v.dispose()}}catch(u){throw v.dispose(),u}}}e.AsyncReferenceCollection=o;class n{constructor(a){this.object=a}dispose(){}}e.ImmortalReference=n;function s(r){const a=new d;try{r(a)}finally{a.dispose()}}e.disposeOnReturn=s;class i{constructor(){this._store=new Map,this._isDisposed=!1,D(this)}dispose(){b(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{h(this._store.values())}finally{this._store.clear()}}has(a){return this._store.has(a)}get(a){return this._store.get(a)}set(a,E,v=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),v||this._store.get(a)?.dispose(),this._store.set(a,E)}deleteAndDispose(a){this._store.get(a)?.dispose(),this._store.delete(a)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}e.DisposableMap=i}),define(ce[87],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedList=void 0;class I{static{this.Undefined=new I(void 0)}constructor(_){this.element=_,this.next=I.Undefined,this.prev=I.Undefined}}class O{constructor(){this._first=I.Undefined,this._last=I.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===I.Undefined}clear(){let _=this._first;for(;_!==I.Undefined;){const k=_.next;_.prev=I.Undefined,_.next=I.Undefined,_=k}this._first=I.Undefined,this._last=I.Undefined,this._size=0}unshift(_){return this._insert(_,!1)}push(_){return this._insert(_,!0)}_insert(_,k){const D=new I(_);if(this._first===I.Undefined)this._first=D,this._last=D;else if(k){const S=this._last;this._last=D,D.prev=S,S.next=D}else{const S=this._first;this._first=D,D.next=S,S.prev=D}this._size+=1;let b=!1;return()=>{b||(b=!0,this._remove(D))}}shift(){if(this._first!==I.Undefined){const _=this._first.element;return this._remove(this._first),_}}pop(){if(this._last!==I.Undefined){const _=this._last.element;return this._remove(this._last),_}}_remove(_){if(_.prev!==I.Undefined&&_.next!==I.Undefined){const k=_.prev;k.next=_.next,_.next.prev=k}else _.prev===I.Undefined&&_.next===I.Undefined?(this._first=I.Undefined,this._last=I.Undefined):_.next===I.Undefined?(this._last=this._last.prev,this._last.next=I.Undefined):_.prev===I.Undefined&&(this._first=this._first.next,this._first.prev=I.Undefined);this._size-=1}*[Symbol.iterator](){let _=this._first;for(;_!==I.Undefined;)yield _.element,_=_.next}}e.LinkedList=O}),define(ce[35],le([0,1]),function(te,e){"use strict";var I,O,A;Object.defineProperty(e,"__esModule",{value:!0}),e.CounterSet=e.LRUCache=e.LinkedMap=e.Touch=e.ResourceSet=e.ResourceMap=e.setToString=e.mapToString=e.getOrSet=void 0;function _(w,l,d){let c=w.get(l);return c===void 0&&(c=d,w.set(l,c)),c}e.getOrSet=_;function k(w){const l=[];return w.forEach((d,c)=>{l.push(`${c} => ${d}`)}),`Map(${w.size}) {${l.join(", ")}}`}e.mapToString=k;function D(w){const l=[];return w.forEach(d=>{l.push(d)}),`Set(${w.size}) {${l.join(", ")}}`}e.setToString=D;class b{constructor(l,d){this.uri=l,this.value=d}}class S{static{this.defaultToKey=l=>l.toString()}constructor(l,d){this[I]="ResourceMap",l instanceof S?(this.map=new Map(l.map),this.toKey=d??S.defaultToKey):(this.map=new Map,this.toKey=l??S.defaultToKey)}set(l,d){return this.map.set(this.toKey(l),new b(l,d)),this}get(l){return this.map.get(this.toKey(l))?.value}has(l){return this.map.has(this.toKey(l))}get size(){return this.map.size}clear(){this.map.clear()}delete(l){return this.map.delete(this.toKey(l))}forEach(l,d){typeof d<"u"&&(l=l.bind(d));for(const[c,m]of this.map)l(m.value,m.uri,this)}*values(){for(const l of this.map.values())yield l.value}*keys(){for(const l of this.map.values())yield l.uri}*entries(){for(const l of this.map.values())yield[l.uri,l.value]}*[(I=Symbol.toStringTag,Symbol.iterator)](){for(const[,l]of this.map)yield[l.uri,l.value]}}e.ResourceMap=S;class P{constructor(l,d){this[O]="ResourceSet",!l||typeof l=="function"?this._map=new S(l):(this._map=new S(d),l.forEach(this.add,this))}get size(){return this._map.size}add(l){return this._map.set(l,l),this}clear(){this._map.clear()}delete(l){return this._map.delete(l)}forEach(l,d){this._map.forEach((c,m)=>l.call(d,m,m,this))}has(l){return this._map.has(l)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(O=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}}e.ResourceSet=P;var p;(function(w){w[w.None=0]="None",w[w.AsOld=1]="AsOld",w[w.AsNew=2]="AsNew"})(p||(e.Touch=p={}));class g{constructor(){this[A]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(l){return this._map.has(l)}get(l,d=0){const c=this._map.get(l);if(c)return d!==0&&this.touch(c,d),c.value}set(l,d,c=0){let m=this._map.get(l);if(m)m.value=d,c!==0&&this.touch(m,c);else{switch(m={key:l,value:d,next:void 0,previous:void 0},c){case 0:this.addItemLast(m);break;case 1:this.addItemFirst(m);break;case 2:this.addItemLast(m);break;default:this.addItemLast(m);break}this._map.set(l,m),this._size++}return this}delete(l){return!!this.remove(l)}remove(l){const d=this._map.get(l);if(d)return this._map.delete(l),this.removeItem(d),this._size--,d.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const l=this._head;return this._map.delete(l.key),this.removeItem(l),this._size--,l.value}forEach(l,d){const c=this._state;let m=this._head;for(;m;){if(d?l.bind(d)(m.value,m.key,this):l(m.value,m.key,this),this._state!==c)throw new Error("LinkedMap got modified during iteration.");m=m.next}}keys(){const l=this,d=this._state;let c=this._head;const m={[Symbol.iterator](){return m},next(){if(l._state!==d)throw new Error("LinkedMap got modified during iteration.");if(c){const y={value:c.key,done:!1};return c=c.next,y}else return{value:void 0,done:!0}}};return m}values(){const l=this,d=this._state;let c=this._head;const m={[Symbol.iterator](){return m},next(){if(l._state!==d)throw new Error("LinkedMap got modified during iteration.");if(c){const y={value:c.value,done:!1};return c=c.next,y}else return{value:void 0,done:!0}}};return m}entries(){const l=this,d=this._state;let c=this._head;const m={[Symbol.iterator](){return m},next(){if(l._state!==d)throw new Error("LinkedMap got modified during iteration.");if(c){const y={value:[c.key,c.value],done:!1};return c=c.next,y}else return{value:void 0,done:!0}}};return m}[(A=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(l){if(l>=this.size)return;if(l===0){this.clear();return}let d=this._head,c=this.size;for(;d&&c>l;)this._map.delete(d.key),d=d.next,c--;this._head=d,this._size=c,d&&(d.previous=void 0),this._state++}addItemFirst(l){if(!this._head&&!this._tail)this._tail=l;else if(this._head)l.next=this._head,this._head.previous=l;else throw new Error("Invalid list");this._head=l,this._state++}addItemLast(l){if(!this._head&&!this._tail)this._head=l;else if(this._tail)l.previous=this._tail,this._tail.next=l;else throw new Error("Invalid list");this._tail=l,this._state++}removeItem(l){if(l===this._head&&l===this._tail)this._head=void 0,this._tail=void 0;else if(l===this._head){if(!l.next)throw new Error("Invalid list");l.next.previous=void 0,this._head=l.next}else if(l===this._tail){if(!l.previous)throw new Error("Invalid list");l.previous.next=void 0,this._tail=l.previous}else{const d=l.next,c=l.previous;if(!d||!c)throw new Error("Invalid list");d.previous=c,c.next=d}l.next=void 0,l.previous=void 0,this._state++}touch(l,d){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(d!==1&&d!==2)){if(d===1){if(l===this._head)return;const c=l.next,m=l.previous;l===this._tail?(m.next=void 0,this._tail=m):(c.previous=m,m.next=c),l.previous=void 0,l.next=this._head,this._head.previous=l,this._head=l,this._state++}else if(d===2){if(l===this._tail)return;const c=l.next,m=l.previous;l===this._head?(c.previous=void 0,this._head=c):(c.previous=m,m.next=c),l.next=void 0,l.previous=this._tail,this._tail.next=l,this._tail=l,this._state++}}}toJSON(){const l=[];return this.forEach((d,c)=>{l.push([c,d])}),l}fromJSON(l){this.clear();for(const[d,c]of l)this.set(d,c)}}e.LinkedMap=g;class h extends g{constructor(l,d=1){super(),this._limit=l,this._ratio=Math.min(Math.max(0,d),1)}get limit(){return this._limit}set limit(l){this._limit=l,this.checkTrim()}get ratio(){return this._ratio}set ratio(l){this._ratio=Math.min(Math.max(0,l),1),this.checkTrim()}get(l,d=2){return super.get(l,d)}peek(l){return super.get(l,0)}set(l,d){return super.set(l,d,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}e.LRUCache=h;class f{constructor(){this.map=new Map}add(l){return this.map.set(l,(this.map.get(l)||0)+1),this}delete(l){let d=this.map.get(l)||0;return d===0?!1:(d--,d===0?this.map.delete(l):this.map.set(l,d),!0)}has(l){return this.map.has(l)}}e.CounterSet=f}),define(ce[88],le([0,1,35]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeAccents=e.normalizeNFD=e.normalizeNFC=void 0;const O=new I.LRUCache(1e4);function A(S){return b(S,"NFC",O)}e.normalizeNFC=A;const _=new I.LRUCache(1e4);function k(S){return b(S,"NFD",_)}e.normalizeNFD=k;const D=/[^\u0000-\u0080]/;function b(S,P,p){if(!S)return S;const g=p.get(S);if(g)return g;let h;return D.test(S)?h=S.normalize(P):h=S,p.set(S,h),h}e.removeAccents=function(){const S=/[\u0300-\u036f]/g;return function(P){return k(P).replace(S,"")}}()}),function(){function te(A){const _=[];typeof A=="number"&&_.push("code/timeOrigin",A);function k(b){_.push(b,Date.now())}function D(){const b=[];for(let S=0;S<_.length;S+=2)b.push({name:_[S],startTime:_[S+1]});return b}return{mark:k,getMarks:D}}function e(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?te():{mark(A){performance.mark(A)},getMarks(){let A=performance.timeOrigin;typeof A!="number"&&(A=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const _=[{name:"code/timeOrigin",startTime:Math.round(A)}];for(const k of performance.getEntriesByType("mark"))_.push({name:k.name,startTime:Math.round(A+k.startTime)});return _}};if(typeof process=="object"){const A=performance?.timeOrigin??Math.round((require.__$__nodeRequire||require)("perf_hooks").performance.timeOrigin);return te(A)}else return console.trace("perf-util loaded in UNKNOWN environment"),te()}function I(A){return A.MonacoPerformanceMarks||(A.MonacoPerformanceMarks=e()),A.MonacoPerformanceMarks}var O;typeof global=="object"?O=global:typeof self=="object"?O=self:O={},typeof define=="function"?define("vs/base/common/performance",[],function(){return I(O)}):typeof module=="object"&&typeof module.exports=="object"?module.exports=I(O):(console.trace("perf-util defined in UNKNOWN context (neither requirejs or commonjs)"),O.perf=I(O))}(),function(te,e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define("vs/base/common/semver/semver",[],e);else{var I=e();for(var O in I)(typeof exports=="object"?exports:te)[O]=I[O]}}(typeof self<"u"?self:this,function(){return function(te){var e={};function I(O){if(e[O])return e[O].exports;var A=e[O]={i:O,l:!1,exports:{}};return te[O].call(A.exports,A,A.exports,I),A.l=!0,A.exports}return I.m=te,I.c=e,I.d=function(O,A,_){I.o(O,A)||Object.defineProperty(O,A,{enumerable:!0,get:_})},I.r=function(O){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(O,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(O,"__esModule",{value:!0})},I.t=function(O,A){if(1&A&&(O=I(O)),8&A||4&A&&typeof O=="object"&&O&&O.__esModule)return O;var _=Object.create(null);if(I.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:O}),2&A&&typeof O!="string")for(var k in O)I.d(_,k,function(D){return O[D]}.bind(null,k));return _},I.n=function(O){var A=O&&O.__esModule?function(){return O.default}:function(){return O};return I.d(A,"a",A),A},I.o=function(O,A){return Object.prototype.hasOwnProperty.call(O,A)},I.p="",I(I.s=0)}([function(te,e,I){(function(O){var A;e=te.exports=ae,A=typeof O=="object"&&O.env&&O.env.NODE_DEBUG&&/\bsemver\b/i.test(O.env.NODE_DEBUG)?function(){var he=Array.prototype.slice.call(arguments,0);he.unshift("SEMVER"),console.log.apply(console,he)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var _=256,k=Number.MAX_SAFE_INTEGER||9007199254740991,D=e.re=[],b=e.src=[],S=0,P=S++;b[P]="0|[1-9]\\d*";var p=S++;b[p]="[0-9]+";var g=S++;b[g]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=S++;b[h]="("+b[P]+")\\.("+b[P]+")\\.("+b[P]+")";var f=S++;b[f]="("+b[p]+")\\.("+b[p]+")\\.("+b[p]+")";var w=S++;b[w]="(?:"+b[P]+"|"+b[g]+")";var l=S++;b[l]="(?:"+b[p]+"|"+b[g]+")";var d=S++;b[d]="(?:-("+b[w]+"(?:\\."+b[w]+")*))";var c=S++;b[c]="(?:-?("+b[l]+"(?:\\."+b[l]+")*))";var m=S++;b[m]="[0-9A-Za-z-]+";var y=S++;b[y]="(?:\\+("+b[m]+"(?:\\."+b[m]+")*))";var T=S++,t="v?"+b[h]+b[d]+"?"+b[y]+"?";b[T]="^"+t+"$";var o="[v=\\s]*"+b[f]+b[c]+"?"+b[y]+"?",n=S++;b[n]="^"+o+"$";var s=S++;b[s]="((?:<|>)?=?)";var i=S++;b[i]=b[p]+"|x|X|\\*";var r=S++;b[r]=b[P]+"|x|X|\\*";var a=S++;b[a]="[v=\\s]*("+b[r]+")(?:\\.("+b[r]+")(?:\\.("+b[r]+")(?:"+b[d]+")?"+b[y]+"?)?)?";var E=S++;b[E]="[v=\\s]*("+b[i]+")(?:\\.("+b[i]+")(?:\\.("+b[i]+")(?:"+b[c]+")?"+b[y]+"?)?)?";var v=S++;b[v]="^"+b[s]+"\\s*"+b[a]+"$";var u=S++;b[u]="^"+b[s]+"\\s*"+b[E]+"$";var C=S++;b[C]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var U=S++;b[U]="(?:~>?)";var F=S++;b[F]="(\\s*)"+b[U]+"\\s+",D[F]=new RegExp(b[F],"g");var M=S++;b[M]="^"+b[U]+b[a]+"$";var z=S++;b[z]="^"+b[U]+b[E]+"$";var V=S++;b[V]="(?:\\^)";var J=S++;b[J]="(\\s*)"+b[V]+"\\s+",D[J]=new RegExp(b[J],"g");var H=S++;b[H]="^"+b[V]+b[a]+"$";var Y=S++;b[Y]="^"+b[V]+b[E]+"$";var B=S++;b[B]="^"+b[s]+"\\s*("+o+")$|^$";var K=S++;b[K]="^"+b[s]+"\\s*("+t+")$|^$";var x=S++;b[x]="(\\s*)"+b[s]+"\\s*("+o+"|"+b[a]+")",D[x]=new RegExp(b[x],"g");var q=S++;b[q]="^\\s*("+b[a]+")\\s+-\\s+("+b[a]+")\\s*$";var j=S++;b[j]="^\\s*("+b[E]+")\\s+-\\s+("+b[E]+")\\s*$";var Z=S++;b[Z]="(<|>)?=?\\s*\\*";for(var oe=0;oe<35;oe++)A(oe,b[oe]),D[oe]||(D[oe]=new RegExp(b[oe]));function ue(he,me){if(he instanceof ae)return he;if(typeof he!="string"||he.length>_||!(me?D[n]:D[T]).test(he))return null;try{return new ae(he,me)}catch{return null}}function ae(he,me){if(he instanceof ae){if(he.loose===me)return he;he=he.version}else if(typeof he!="string")throw new TypeError("Invalid Version: "+he);if(he.length>_)throw new TypeError("version is longer than "+_+" characters");if(!(this instanceof ae))return new ae(he,me);A("SemVer",he,me),this.loose=me;var Se=he.trim().match(me?D[n]:D[T]);if(!Se)throw new TypeError("Invalid Version: "+he);if(this.raw=he,this.major=+Se[1],this.minor=+Se[2],this.patch=+Se[3],this.major>k||this.major<0)throw new TypeError("Invalid major version");if(this.minor>k||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>k||this.patch<0)throw new TypeError("Invalid patch version");Se[4]?this.prerelease=Se[4].split(".").map(function(Ie){if(/^[0-9]+$/.test(Ie)){var Le=+Ie;if(Le>=0&&Le<k)return Le}return Ie}):this.prerelease=[],this.build=Se[5]?Se[5].split("."):[],this.format()}e.parse=ue,e.valid=function(he,me){var Se=ue(he,me);return Se?Se.version:null},e.clean=function(he,me){var Se=ue(he.trim().replace(/^[=v]+/,""),me);return Se?Se.version:null},e.SemVer=ae,ae.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},ae.prototype.toString=function(){return this.version},ae.prototype.compare=function(he){return A("SemVer.compare",this.version,this.loose,he),he instanceof ae||(he=new ae(he,this.loose)),this.compareMain(he)||this.comparePre(he)},ae.prototype.compareMain=function(he){return he instanceof ae||(he=new ae(he,this.loose)),R(this.major,he.major)||R(this.minor,he.minor)||R(this.patch,he.patch)},ae.prototype.comparePre=function(he){if(he instanceof ae||(he=new ae(he,this.loose)),this.prerelease.length&&!he.prerelease.length)return-1;if(!this.prerelease.length&&he.prerelease.length)return 1;if(!this.prerelease.length&&!he.prerelease.length)return 0;var me=0;do{var Se=this.prerelease[me],Ie=he.prerelease[me];if(A("prerelease compare",me,Se,Ie),Se===void 0&&Ie===void 0)return 0;if(Ie===void 0)return 1;if(Se===void 0)return-1;if(Se!==Ie)return R(Se,Ie)}while(++me)},ae.prototype.inc=function(he,me){switch(he){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",me);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",me);break;case"prepatch":this.prerelease.length=0,this.inc("patch",me),this.inc("pre",me);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",me),this.inc("pre",me);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var Se=this.prerelease.length;--Se>=0;)typeof this.prerelease[Se]=="number"&&(this.prerelease[Se]++,Se=-2);Se===-1&&this.prerelease.push(0)}me&&(this.prerelease[0]===me?isNaN(this.prerelease[1])&&(this.prerelease=[me,0]):this.prerelease=[me,0]);break;default:throw new Error("invalid increment argument: "+he)}return this.format(),this.raw=this.version,this},e.inc=function(he,me,Se,Ie){typeof Se=="string"&&(Ie=Se,Se=void 0);try{return new ae(he,Se).inc(me,Ie).version}catch{return null}},e.diff=function(he,me){if(X(he,me))return null;var Se=ue(he),Ie=ue(me);if(Se.prerelease.length||Ie.prerelease.length){for(var Le in Se)if((Le==="major"||Le==="minor"||Le==="patch")&&Se[Le]!==Ie[Le])return"pre"+Le;return"prerelease"}for(var Le in Se)if((Le==="major"||Le==="minor"||Le==="patch")&&Se[Le]!==Ie[Le])return Le},e.compareIdentifiers=R;var $=/^[0-9]+$/;function R(he,me){var Se=$.test(he),Ie=$.test(me);return Se&&Ie&&(he=+he,me=+me),Se&&!Ie?-1:Ie&&!Se?1:he<me?-1:he>me?1:0}function L(he,me,Se){return new ae(he,Se).compare(new ae(me,Se))}function N(he,me,Se){return L(he,me,Se)>0}function W(he,me,Se){return L(he,me,Se)<0}function X(he,me,Se){return L(he,me,Se)===0}function ne(he,me,Se){return L(he,me,Se)!==0}function re(he,me,Se){return L(he,me,Se)>=0}function Q(he,me,Se){return L(he,me,Se)<=0}function ee(he,me,Se,Ie){var Le;switch(me){case"===":typeof he=="object"&&(he=he.version),typeof Se=="object"&&(Se=Se.version),Le=he===Se;break;case"!==":typeof he=="object"&&(he=he.version),typeof Se=="object"&&(Se=Se.version),Le=he!==Se;break;case"":case"=":case"==":Le=X(he,Se,Ie);break;case"!=":Le=ne(he,Se,Ie);break;case">":Le=N(he,Se,Ie);break;case">=":Le=re(he,Se,Ie);break;case"<":Le=W(he,Se,Ie);break;case"<=":Le=Q(he,Se,Ie);break;default:throw new TypeError("Invalid operator: "+me)}return Le}function ie(he,me){if(he instanceof ie){if(he.loose===me)return he;he=he.value}if(!(this instanceof ie))return new ie(he,me);A("comparator",he,me),this.loose=me,this.parse(he),this.semver===de?this.value="":this.value=this.operator+this.semver.version,A("comp",this)}e.rcompareIdentifiers=function(he,me){return R(me,he)},e.major=function(he,me){return new ae(he,me).major},e.minor=function(he,me){return new ae(he,me).minor},e.patch=function(he,me){return new ae(he,me).patch},e.compare=L,e.compareLoose=function(he,me){return L(he,me,!0)},e.rcompare=function(he,me,Se){return L(me,he,Se)},e.sort=function(he,me){return he.sort(function(Se,Ie){return e.compare(Se,Ie,me)})},e.rsort=function(he,me){return he.sort(function(Se,Ie){return e.rcompare(Se,Ie,me)})},e.gt=N,e.lt=W,e.eq=X,e.neq=ne,e.gte=re,e.lte=Q,e.cmp=ee,e.Comparator=ie;var de={};function fe(he,me){if(he instanceof fe)return he.loose===me?he:new fe(he.raw,me);if(he instanceof ie)return new fe(he.value,me);if(!(this instanceof fe))return new fe(he,me);if(this.loose=me,this.raw=he,this.set=he.split(/\s*\|\|\s*/).map(function(Se){return this.parseRange(Se.trim())},this).filter(function(Se){return Se.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+he);this.format()}function pe(he){return!he||he.toLowerCase()==="x"||he==="*"}function ye(he,me,Se,Ie,Le,$e,_e,ze,Oe,Me,se,ge,ve){return((me=pe(Se)?"":pe(Ie)?">="+Se+".0.0":pe(Le)?">="+Se+"."+Ie+".0":">="+me)+" "+(ze=pe(Oe)?"":pe(Me)?"<"+(+Oe+1)+".0.0":pe(se)?"<"+Oe+"."+(+Me+1)+".0":ge?"<="+Oe+"."+Me+"."+se+"-"+ge:"<="+ze)).trim()}function De(he,me){for(var Se=0;Se<he.length;Se++)if(!he[Se].test(me))return!1;if(me.prerelease.length){for(Se=0;Se<he.length;Se++)if(A(he[Se].semver),he[Se].semver!==de&&he[Se].semver.prerelease.length>0){var Ie=he[Se].semver;if(Ie.major===me.major&&Ie.minor===me.minor&&Ie.patch===me.patch)return!0}return!1}return!0}function ke(he,me,Se){try{me=new fe(me,Se)}catch{return!1}return me.test(he)}function Ue(he,me,Se,Ie){var Le,$e,_e,ze,Oe;switch(he=new ae(he,Ie),me=new fe(me,Ie),Se){case">":Le=N,$e=Q,_e=W,ze=">",Oe=">=";break;case"<":Le=W,$e=re,_e=N,ze="<",Oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ke(he,me,Ie))return!1;for(var Me=0;Me<me.set.length;++Me){var se=me.set[Me],ge=null,ve=null;if(se.forEach(function(we){we.semver===de&&(we=new ie(">=0.0.0")),ge=ge||we,ve=ve||we,Le(we.semver,ge.semver,Ie)?ge=we:_e(we.semver,ve.semver,Ie)&&(ve=we)}),ge.operator===ze||ge.operator===Oe||(!ve.operator||ve.operator===ze)&&$e(he,ve.semver)||ve.operator===Oe&&_e(he,ve.semver))return!1}return!0}ie.prototype.parse=function(he){var me=this.loose?D[B]:D[K],Se=he.match(me);if(!Se)throw new TypeError("Invalid comparator: "+he);this.operator=Se[1],this.operator==="="&&(this.operator=""),Se[2]?this.semver=new ae(Se[2],this.loose):this.semver=de},ie.prototype.toString=function(){return this.value},ie.prototype.test=function(he){return A("Comparator.test",he,this.loose),this.semver===de||(typeof he=="string"&&(he=new ae(he,this.loose)),ee(he,this.operator,this.semver,this.loose))},ie.prototype.intersects=function(he,me){if(!(he instanceof ie))throw new TypeError("a Comparator is required");var Se;if(this.operator==="")return Se=new fe(he.value,me),ke(this.value,Se,me);if(he.operator==="")return Se=new fe(this.value,me),ke(he.semver,Se,me);var Ie=!(this.operator!==">="&&this.operator!==">"||he.operator!==">="&&he.operator!==">"),Le=!(this.operator!=="<="&&this.operator!=="<"||he.operator!=="<="&&he.operator!=="<"),$e=this.semver.version===he.semver.version,_e=!(this.operator!==">="&&this.operator!=="<="||he.operator!==">="&&he.operator!=="<="),ze=ee(this.semver,"<",he.semver,me)&&(this.operator===">="||this.operator===">")&&(he.operator==="<="||he.operator==="<"),Oe=ee(this.semver,">",he.semver,me)&&(this.operator==="<="||this.operator==="<")&&(he.operator===">="||he.operator===">");return Ie||Le||$e&&_e||ze||Oe},e.Range=fe,fe.prototype.format=function(){return this.range=this.set.map(function(he){return he.join(" ").trim()}).join("||").trim(),this.range},fe.prototype.toString=function(){return this.range},fe.prototype.parseRange=function(he){var me=this.loose;he=he.trim(),A("range",he,me);var Se=me?D[j]:D[q];he=he.replace(Se,ye),A("hyphen replace",he),he=he.replace(D[x],"$1$2$3"),A("comparator trim",he,D[x]),he=(he=(he=he.replace(D[F],"$1~")).replace(D[J],"$1^")).split(/\s+/).join(" ");var Ie=me?D[B]:D[K],Le=he.split(" ").map(function($e){return function(_e,ze){return A("comp",_e),_e=function(Oe,Me){return Oe.trim().split(/\s+/).map(function(se){return function(ge,ve){A("caret",ge,ve);var we=ve?D[Y]:D[H];return ge.replace(we,function(Pe,be,Re,Te,Ae){var Ne;return A("caret",ge,Pe,be,Re,Te,Ae),pe(be)?Ne="":pe(Re)?Ne=">="+be+".0.0 <"+(+be+1)+".0.0":pe(Te)?Ne=be==="0"?">="+be+"."+Re+".0 <"+be+"."+(+Re+1)+".0":">="+be+"."+Re+".0 <"+(+be+1)+".0.0":Ae?(A("replaceCaret pr",Ae),Ae.charAt(0)!=="-"&&(Ae="-"+Ae),Ne=be==="0"?Re==="0"?">="+be+"."+Re+"."+Te+Ae+" <"+be+"."+Re+"."+(+Te+1):">="+be+"."+Re+"."+Te+Ae+" <"+be+"."+(+Re+1)+".0":">="+be+"."+Re+"."+Te+Ae+" <"+(+be+1)+".0.0"):(A("no pr"),Ne=be==="0"?Re==="0"?">="+be+"."+Re+"."+Te+" <"+be+"."+Re+"."+(+Te+1):">="+be+"."+Re+"."+Te+" <"+be+"."+(+Re+1)+".0":">="+be+"."+Re+"."+Te+" <"+(+be+1)+".0.0"),A("caret return",Ne),Ne})}(se,Me)}).join(" ")}(_e,ze),A("caret",_e),_e=function(Oe,Me){return Oe.trim().split(/\s+/).map(function(se){return function(ge,ve){var we=ve?D[z]:D[M];return ge.replace(we,function(Pe,be,Re,Te,Ae){var Ne;return A("tilde",ge,Pe,be,Re,Te,Ae),pe(be)?Ne="":pe(Re)?Ne=">="+be+".0.0 <"+(+be+1)+".0.0":pe(Te)?Ne=">="+be+"."+Re+".0 <"+be+"."+(+Re+1)+".0":Ae?(A("replaceTilde pr",Ae),Ae.charAt(0)!=="-"&&(Ae="-"+Ae),Ne=">="+be+"."+Re+"."+Te+Ae+" <"+be+"."+(+Re+1)+".0"):Ne=">="+be+"."+Re+"."+Te+" <"+be+"."+(+Re+1)+".0",A("tilde return",Ne),Ne})}(se,Me)}).join(" ")}(_e,ze),A("tildes",_e),_e=function(Oe,Me){return A("replaceXRanges",Oe,Me),Oe.split(/\s+/).map(function(se){return function(ge,ve){ge=ge.trim();var we=ve?D[u]:D[v];return ge.replace(we,function(Pe,be,Re,Te,Ae,Ne){A("xRange",ge,Pe,be,Re,Te,Ae,Ne);var We=pe(Re),je=We||pe(Te),qe=je||pe(Ae);return be==="="&&qe&&(be=""),We?Pe=be===">"||be==="<"?"<0.0.0":"*":be&&qe?(je&&(Te=0),qe&&(Ae=0),be===">"?(be=">=",je?(Re=+Re+1,Te=0,Ae=0):qe&&(Te=+Te+1,Ae=0)):be==="<="&&(be="<",je?Re=+Re+1:Te=+Te+1),Pe=be+Re+"."+Te+"."+Ae):je?Pe=">="+Re+".0.0 <"+(+Re+1)+".0.0":qe&&(Pe=">="+Re+"."+Te+".0 <"+Re+"."+(+Te+1)+".0"),A("xRange return",Pe),Pe})}(se,Me)}).join(" ")}(_e,ze),A("xrange",_e),_e=function(Oe,Me){return A("replaceStars",Oe,Me),Oe.trim().replace(D[Z],"")}(_e,ze),A("stars",_e),_e}($e,me)}).join(" ").split(/\s+/);return this.loose&&(Le=Le.filter(function($e){return!!$e.match(Ie)})),Le=Le.map(function($e){return new ie($e,me)})},fe.prototype.intersects=function(he,me){if(!(he instanceof fe))throw new TypeError("a Range is required");return this.set.some(function(Se){return Se.every(function(Ie){return he.set.some(function(Le){return Le.every(function($e){return Ie.intersects($e,me)})})})})},e.toComparators=function(he,me){return new fe(he,me).set.map(function(Se){return Se.map(function(Ie){return Ie.value}).join(" ").trim().split(" ")})},fe.prototype.test=function(he){if(!he)return!1;typeof he=="string"&&(he=new ae(he,this.loose));for(var me=0;me<this.set.length;me++)if(De(this.set[me],he))return!0;return!1},e.satisfies=ke,e.maxSatisfying=function(he,me,Se){var Ie=null,Le=null;try{var $e=new fe(me,Se)}catch{return null}return he.forEach(function(_e){$e.test(_e)&&(Ie&&Le.compare(_e)!==-1||(Le=new ae(Ie=_e,Se)))}),Ie},e.minSatisfying=function(he,me,Se){var Ie=null,Le=null;try{var $e=new fe(me,Se)}catch{return null}return he.forEach(function(_e){$e.test(_e)&&(Ie&&Le.compare(_e)!==1||(Le=new ae(Ie=_e,Se)))}),Ie},e.validRange=function(he,me){try{return new fe(he,me).range||"*"}catch{return null}},e.ltr=function(he,me,Se){return Ue(he,me,"<",Se)},e.gtr=function(he,me,Se){return Ue(he,me,">",Se)},e.outside=Ue,e.prerelease=function(he,me){var Se=ue(he,me);return Se&&Se.prerelease.length?Se.prerelease:null},e.intersects=function(he,me,Se){return he=new fe(he,Se),me=new fe(me,Se),he.intersects(me)},e.coerce=function(he){if(he instanceof ae)return he;if(typeof he!="string")return null;var me=he.match(D[C]);return me==null?null:ue((me[1]||"0")+"."+(me[2]||"0")+"."+(me[3]||"0"))}}).call(this,I(1))},function(te,e){var I,O,A=te.exports={};function _(){throw new Error("setTimeout has not been defined")}function k(){throw new Error("clearTimeout has not been defined")}function D(l){if(I===setTimeout)return setTimeout(l,0);if((I===_||!I)&&setTimeout)return I=setTimeout,setTimeout(l,0);try{return I(l,0)}catch{try{return I.call(null,l,0)}catch{return I.call(this,l,0)}}}(function(){try{I=typeof setTimeout=="function"?setTimeout:_}catch{I=_}try{O=typeof clearTimeout=="function"?clearTimeout:k}catch{O=k}})();var b,S=[],P=!1,p=-1;function g(){P&&b&&(P=!1,b.length?S=b.concat(S):p=-1,S.length&&h())}function h(){if(!P){var l=D(g);P=!0;for(var d=S.length;d;){for(b=S,S=[];++p<d;)b&&b[p].run();p=-1,d=S.length}b=null,P=!1,function(c){if(O===clearTimeout)return clearTimeout(c);if((O===k||!O)&&clearTimeout)return O=clearTimeout,clearTimeout(c);try{O(c)}catch{try{return O.call(null,c)}catch{return O.call(this,c)}}}(l)}}function f(l,d){this.fun=l,this.array=d}function w(){}A.nextTick=function(l){var d=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)d[c-1]=arguments[c];S.push(new f(l,d)),S.length!==1||P||D(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},A.title="browser",A.browser=!0,A.env={},A.argv=[],A.version="",A.versions={},A.on=w,A.addListener=w,A.once=w,A.off=w,A.removeListener=w,A.removeAllListeners=w,A.emit=w,A.prependListener=w,A.prependOnceListener=w,A.listeners=function(l){return[]},A.binding=function(l){throw new Error("process.binding is not supported")},A.cwd=function(){return"/"},A.chdir=function(l){throw new Error("process.chdir is not supported")},A.umask=function(){return 0}}])}),define(ce[127],le([0,1]),function(te,e){"use strict";var I;Object.defineProperty(e,"__esModule",{value:!0}),e.SkipList=void 0;class O{constructor(D,b,S){this.level=D,this.key=b,this.value=S,this.forward=[]}}const A=void 0;class _{constructor(D,b=2**16){this.comparator=D,this[I]="SkipList",this._level=0,this._size=0,this._maxLevel=Math.max(1,Math.log2(b)|0),this._header=new O(this._maxLevel,A,A)}get size(){return this._size}clear(){this._header=new O(this._maxLevel,A,A)}has(D){return!!_._search(this,D,this.comparator)}get(D){return _._search(this,D,this.comparator)?.value}set(D,b){return _._insert(this,D,b,this.comparator)&&(this._size+=1),this}delete(D){const b=_._delete(this,D,this.comparator);return b&&(this._size-=1),b}forEach(D,b){let S=this._header.forward[0];for(;S;)D.call(b,S.value,S.key,this),S=S.forward[0]}[(I=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let D=this._header.forward[0];for(;D;)yield[D.key,D.value],D=D.forward[0]}*keys(){let D=this._header.forward[0];for(;D;)yield D.key,D=D.forward[0]}*values(){let D=this._header.forward[0];for(;D;)yield D.value,D=D.forward[0]}toString(){let D="[SkipList]:",b=this._header.forward[0];for(;b;)D+=`node(${b.key}, ${b.value}, lvl:${b.level})`,b=b.forward[0];return D}static _search(D,b,S){let P=D._header;for(let p=D._level-1;p>=0;p--)for(;P.forward[p]&&S(P.forward[p].key,b)<0;)P=P.forward[p];if(P=P.forward[0],P&&S(P.key,b)===0)return P}static _insert(D,b,S,P){const p=[];let g=D._header;for(let h=D._level-1;h>=0;h--){for(;g.forward[h]&&P(g.forward[h].key,b)<0;)g=g.forward[h];p[h]=g}if(g=g.forward[0],g&&P(g.key,b)===0)return g.value=S,!1;{const h=_._randomLevel(D);if(h>D._level){for(let f=D._level;f<h;f++)p[f]=D._header;D._level=h}g=new O(h,b,S);for(let f=0;f<h;f++)g.forward[f]=p[f].forward[f],p[f].forward[f]=g;return!0}}static _randomLevel(D,b=.5){let S=1;for(;Math.random()<b&&S<D._maxLevel;)S+=1;return S}static _delete(D,b,S){const P=[];let p=D._header;for(let g=D._level-1;g>=0;g--){for(;p.forward[g]&&S(p.forward[g].key,b)<0;)p=p.forward[g];P[g]=p}if(p=p.forward[0],!p||S(p.key,b)!==0)return!1;for(let g=0;g<D._level&&P[g].forward[g]===p;g++)P[g].forward[g]=p.forward[g];for(;D._level>0&&D._header.forward[D._level-1]===A;)D._level-=1;return!0}}e.SkipList=_}),define(ce[89],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StopWatch=void 0;const I=globalThis.performance&&typeof globalThis.performance.now=="function";class O{static create(_){return new O(_)}constructor(_){this._now=I&&_===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}e.StopWatch=O}),define(ce[3],le([0,1,8,84,2,87,89]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Relay=e.EventBufferer=e.DynamicListEventMultiplexer=e.EventMultiplexer=e.MicrotaskEmitter=e.DebounceEmitter=e.PauseableEmitter=e.AsyncEmitter=e.createEventDeliveryQueue=e.Emitter=e.setGlobalLeakWarningThreshold=e.EventProfiling=e.Event=void 0;const D=!1,b=!1;var S;(function(v){v.None=()=>A.Disposable.None;function u(re){if(b){const{onDidAddListener:Q}=re,ee=f.create();let ie=0;re.onDidAddListener=()=>{++ie===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),ee.print()),Q?.()}}}function C(re,Q){return B(re,()=>{},0,void 0,!0,void 0,Q)}v.defer=C;function U(re){return(Q,ee=null,ie)=>{let de=!1,fe;return fe=re(pe=>{if(!de)return fe?fe.dispose():de=!0,Q.call(ee,pe)},null,ie),de&&fe.dispose(),fe}}v.once=U;function F(re,Q,ee){return Y((ie,de=null,fe)=>re(pe=>ie.call(de,Q(pe)),null,fe),ee)}v.map=F;function M(re,Q,ee){return Y((ie,de=null,fe)=>re(pe=>{Q(pe),ie.call(de,pe)},null,fe),ee)}v.forEach=M;function z(re,Q,ee){return Y((ie,de=null,fe)=>re(pe=>Q(pe)&&ie.call(de,pe),null,fe),ee)}v.filter=z;function V(re){return re}v.signal=V;function J(...re){return(Q,ee=null,ie)=>(0,A.combinedDisposable)(...re.map(de=>de(fe=>Q.call(ee,fe),null,ie)))}v.any=J;function H(re,Q,ee,ie){let de=ee;return F(re,fe=>(de=Q(de,fe),de),ie)}v.reduce=H;function Y(re,Q){let ee;const ie={onWillAddFirstListener(){ee=re(de.fire,de)},onDidRemoveLastListener(){ee?.dispose()}};Q||u(ie);const de=new m(ie);return Q?.add(de),de.event}function B(re,Q,ee=100,ie=!1,de=!1,fe,pe){let ye,De,ke,Ue=0,he;const me={leakWarningThreshold:fe,onWillAddFirstListener(){ye=re(Ie=>{Ue++,De=Q(De,Ie),ie&&!ke&&(Se.fire(De),De=void 0),he=()=>{const Le=De;De=void 0,ke=void 0,(!ie||Ue>1)&&Se.fire(Le),Ue=0},typeof ee=="number"?(clearTimeout(ke),ke=setTimeout(he,ee)):ke===void 0&&(ke=0,queueMicrotask(he))})},onWillRemoveListener(){de&&Ue>0&&he?.()},onDidRemoveLastListener(){he=void 0,ye.dispose()}};pe||u(me);const Se=new m(me);return pe?.add(Se),Se.event}v.debounce=B;function K(re,Q=0,ee){return v.debounce(re,(ie,de)=>ie?(ie.push(de),ie):[de],Q,void 0,!0,void 0,ee)}v.accumulate=K;function x(re,Q=(ie,de)=>ie===de,ee){let ie=!0,de;return z(re,fe=>{const pe=ie||!Q(fe,de);return ie=!1,de=fe,pe},ee)}v.latch=x;function q(re,Q,ee){return[v.filter(re,Q,ee),v.filter(re,ie=>!Q(ie),ee)]}v.split=q;function j(re,Q=!1,ee=[]){let ie=ee.slice(),de=re(ye=>{ie?ie.push(ye):pe.fire(ye)});const fe=()=>{ie?.forEach(ye=>pe.fire(ye)),ie=null},pe=new m({onWillAddFirstListener(){de||(de=re(ye=>pe.fire(ye)))},onDidAddFirstListener(){ie&&(Q?setTimeout(fe):fe())},onDidRemoveLastListener(){de&&de.dispose(),de=null}});return pe.event}v.buffer=j;class Z{constructor(Q){this.event=Q,this.disposables=new A.DisposableStore}map(Q){return new Z(F(this.event,Q,this.disposables))}forEach(Q){return new Z(M(this.event,Q,this.disposables))}filter(Q){return new Z(z(this.event,Q,this.disposables))}reduce(Q,ee){return new Z(H(this.event,Q,ee,this.disposables))}latch(){return new Z(x(this.event,void 0,this.disposables))}debounce(Q,ee=100,ie=!1,de=!1,fe){return new Z(B(this.event,Q,ee,ie,de,fe,this.disposables))}on(Q,ee,ie){return this.event(Q,ee,ie)}once(Q,ee,ie){return U(this.event)(Q,ee,ie)}dispose(){this.disposables.dispose()}}function oe(re){return new Z(re)}v.chain=oe;function ue(re,Q,ee=ie=>ie){const ie=(...ye)=>pe.fire(ee(...ye)),de=()=>re.on(Q,ie),fe=()=>re.removeListener(Q,ie),pe=new m({onWillAddFirstListener:de,onDidRemoveLastListener:fe});return pe.event}v.fromNodeEventEmitter=ue;function ae(re,Q,ee=ie=>ie){const ie=(...ye)=>pe.fire(ee(...ye)),de=()=>re.addEventListener(Q,ie),fe=()=>re.removeEventListener(Q,ie),pe=new m({onWillAddFirstListener:de,onDidRemoveLastListener:fe});return pe.event}v.fromDOMEventEmitter=ae;function $(re){return new Promise(Q=>U(re)(Q))}v.toPromise=$;function R(re){const Q=new m;return re.then(ee=>{Q.fire(ee)},()=>{Q.fire(void 0)}).finally(()=>{Q.dispose()}),Q.event}v.fromPromise=R;function L(re,Q){return Q(void 0),re(ee=>Q(ee))}v.runAndSubscribe=L;function N(re,Q){let ee=null;function ie(fe){ee?.dispose(),ee=new A.DisposableStore,Q(fe,ee)}ie(void 0);const de=re(fe=>ie(fe));return(0,A.toDisposable)(()=>{de.dispose(),ee?.dispose()})}v.runAndSubscribeWithStore=N;class W{constructor(Q,ee){this._observable=Q,this._counter=0,this._hasChanged=!1;const ie={onWillAddFirstListener:()=>{Q.addObserver(this)},onDidRemoveLastListener:()=>{Q.removeObserver(this)}};ee||u(ie),this.emitter=new m(ie),ee&&ee.add(this.emitter)}beginUpdate(Q){this._counter++}handlePossibleChange(Q){}handleChange(Q,ee){this._hasChanged=!0}endUpdate(Q){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function X(re,Q){return new W(re,Q).emitter.event}v.fromObservable=X;function ne(re){return Q=>{let ee=0,ie=!1;const de={beginUpdate(){ee++},endUpdate(){ee--,ee===0&&(re.reportChanges(),ie&&(ie=!1,Q()))},handlePossibleChange(){},handleChange(){ie=!0}};return re.addObserver(de),re.reportChanges(),{dispose(){re.removeObserver(de)}}}}v.fromObservableLight=ne})(S||(e.Event=S={}));class P{static{this.all=new Set}static{this._idPool=0}constructor(u){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${u}_${P._idPool++}`,P.all.add(this)}start(u){this._stopWatch=new k.StopWatch,this.listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this.durations.push(u),this.elapsedOverall+=u,this.invocationCount+=1,this._stopWatch=void 0}}}e.EventProfiling=P;let p=-1;function g(v){const u=p;return p=v,{dispose(){p=u}}}e.setGlobalLeakWarningThreshold=g;class h{constructor(u,C=Math.random().toString(18).slice(2,5)){this.threshold=u,this.name=C,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(u,C){const U=this.threshold;if(U<=0||C<U)return;this._stacks||(this._stacks=new Map);const F=this._stacks.get(u.value)||0;if(this._stacks.set(u.value,F+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=U*.5;let M,z=0;for(const[V,J]of this._stacks)(!M||z<J)&&(M=V,z=J);console.warn(`[${this.name}] potential listener LEAK detected, having ${C} listeners already. MOST frequent listener (${z}):`),console.warn(M)}return()=>{const M=this._stacks.get(u.value)||0;this._stacks.set(u.value,M-1)}}}class f{static create(){return new f(new Error().stack??"")}constructor(u){this.value=u}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}}let w=0;class l{constructor(u){this.value=u,this.id=w++}}const d=2,c=(v,u)=>{if(v instanceof l)u(v);else for(let C=0;C<v.length;C++){const U=v[C];U&&u(U)}};class m{constructor(u){this._size=0,this._options=u,this._leakageMon=p>0||this._options?.leakWarningThreshold?new h(this._options?.leakWarningThreshold??p):void 0,this._perfMon=this._options?._profName?new P(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(D){const u=this._listeners;queueMicrotask(()=>{c(u,C=>C.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(u,C,U)=>{if(this._disposed)return A.Disposable.None;C&&(u=u.bind(C));const F=new l(u);let M,z;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(F.stack=f.create(),M=this._leakageMon.check(F.stack,this._size+1)),D&&(F.stack=z??f.create()),this._listeners?this._listeners instanceof l?(this._deliveryQueue??=new T,this._listeners=[this._listeners,F]):this._listeners.push(F):(this._options?.onWillAddFirstListener?.(this),this._listeners=F,this._options?.onDidAddFirstListener?.(this)),this._size++;const V=(0,A.toDisposable)(()=>{M?.(),this._removeListener(F)});return U instanceof A.DisposableStore?U.add(V):Array.isArray(U)&&U.push(V),V},this._event}_removeListener(u){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}const C=this._listeners,U=C.indexOf(u);if(U===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,C[U]=void 0;const F=this._deliveryQueue.current===this;if(this._size*d<=C.length){let M=0;for(let z=0;z<C.length;z++)C[z]?C[M++]=C[z]:F&&(this._deliveryQueue.end--,M<this._deliveryQueue.i&&this._deliveryQueue.i--);C.length=M}}_deliver(u,C){if(!u)return;const U=this._options?.onListenerError||I.onUnexpectedError;if(!U){u.value(C);return}try{u.value(C)}catch(F){U(F)}}_deliverQueue(u){const C=u.current._listeners;for(;u.i<u.end;)this._deliver(C[u.i++],u.value);u.reset()}fire(u){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof l)this._deliver(this._listeners,u);else{const C=this._deliveryQueue;C.enqueue(this,u,this._listeners.length),this._deliverQueue(C)}this._perfMon?.stop()}hasListeners(){return this._size>0}}e.Emitter=m;const y=()=>new T;e.createEventDeliveryQueue=y;class T{constructor(){this.i=-1,this.end=0}enqueue(u,C,U){this.i=0,this.end=U,this.current=u,this.value=C}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class t extends m{async fireAsync(u,C,U){if(this._listeners)for(this._asyncDeliveryQueue||(this._asyncDeliveryQueue=new _.LinkedList),c(this._listeners,F=>this._asyncDeliveryQueue.push([F.value,u]));this._asyncDeliveryQueue.size>0&&!C.isCancellationRequested;){const[F,M]=this._asyncDeliveryQueue.shift(),z=[],V={...M,token:C,waitUntil:J=>{if(Object.isFrozen(z))throw new Error("waitUntil can NOT be called asynchronous");U&&(J=U(J,F)),z.push(J)}};try{F(V)}catch(J){(0,I.onUnexpectedError)(J);continue}Object.freeze(z),await Promise.allSettled(z).then(J=>{for(const H of J)H.status==="rejected"&&(0,I.onUnexpectedError)(H.reason)})}}}e.AsyncEmitter=t;class o extends m{get isPaused(){return this._isPaused!==0}constructor(u){super(u),this._isPaused=0,this._eventQueue=new _.LinkedList,this._mergeFn=u?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._size&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}e.PauseableEmitter=o;class n extends o{constructor(u){super(u),this._delay=u.delay??100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}e.DebounceEmitter=n;class s extends m{constructor(u){super(u),this._queuedEvents=[],this._mergeFn=u?.merge}fire(u){this.hasListeners()&&(this._queuedEvents.push(u),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(C=>super.fire(C)),this._queuedEvents=[]}))}}e.MicrotaskEmitter=s;class i{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new m({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(u){const C={event:u,listener:null};this.events.push(C),this.hasListeners&&this.hook(C);const U=()=>{this.hasListeners&&this.unhook(C);const F=this.events.indexOf(C);this.events.splice(F,1)};return(0,A.toDisposable)((0,O.once)(U))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(u=>this.hook(u))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(u=>this.unhook(u))}hook(u){u.listener=u.event(C=>this.emitter.fire(C))}unhook(u){u.listener&&u.listener.dispose(),u.listener=null}dispose(){this.emitter.dispose()}}e.EventMultiplexer=i;class r{constructor(u,C,U,F){this._store=new A.DisposableStore;const M=this._store.add(new i),z=this._store.add(new A.DisposableMap);function V(J){z.set(J,M.add(F(J)))}for(const J of u)V(J);this._store.add(C(J=>{V(J)})),this._store.add(U(J=>{z.deleteAndDispose(J)})),this.event=M.event}dispose(){this._store.dispose()}}e.DynamicListEventMultiplexer=r;class a{constructor(){this.buffers=[]}wrapEvent(u){return(C,U,F)=>u(M=>{const z=this.buffers[this.buffers.length-1];z?z.push(()=>C.call(U,M)):C.call(U,M)},void 0,F)}bufferEvents(u){const C=[];this.buffers.push(C);const U=u();return this.buffers.pop(),C.forEach(F=>F()),U}}e.EventBufferer=a;class E{constructor(){this.listening=!1,this.inputEvent=S.None,this.inputEventListener=A.Disposable.None,this.emitter=new m({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}e.Relay=E}),define(ce[25],le([0,1,3]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;const O=Object.freeze(function(D,b){const S=setTimeout(D.bind(b),0);return{dispose(){clearTimeout(S)}}});var A;(function(D){function b(S){return S===D.None||S===D.Cancelled||S instanceof _?!0:!S||typeof S!="object"?!1:typeof S.isCancellationRequested=="boolean"&&typeof S.onCancellationRequested=="function"}D.isCancellationToken=b,D.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:I.Event.None}),D.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:O})})(A||(e.CancellationToken=A={}));class _{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?O:(this._emitter||(this._emitter=new I.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class k{constructor(b){this._token=void 0,this._parentListener=void 0,this._parentListener=b&&b.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new _),this._token}cancel(){this._token?this._token instanceof _&&this._token.cancel():this._token=A.Cancelled}dispose(b=!1){b&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof _&&this._token.dispose():this._token=A.None}}e.CancellationTokenSource=k}),define(ce[128],le([0,1,25]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CachedFunction=e.LRUCachedFunction=e.Cache=void 0;class O{constructor(D){this.task=D,this.result=null}get(){if(this.result)return this.result;const D=new I.CancellationTokenSource,b=this.task(D.token);return this.result={promise:b,dispose:()=>{this.result=null,D.cancel(),D.dispose()}},this.result}}e.Cache=O;class A{constructor(D){this.fn=D,this.lastCache=void 0,this.lastArgKey=void 0}get(D){const b=JSON.stringify(D);return this.lastArgKey!==b&&(this.lastArgKey=b,this.lastCache=this.fn(D)),this.lastCache}}e.LRUCachedFunction=A;class _{get cachedValues(){return this._map}constructor(D){this.fn=D,this._map=new Map}get(D){if(this._map.has(D))return this._map.get(D);const b=this.fn(D);return this._map.set(D,b),b}}e.CachedFunction=_}),define(ce[43],le([0,1,8,2]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prefixedStream=e.prefixedReadable=e.transform=e.toReadable=e.emptyStream=e.toStream=e.peekStream=e.listenStream=e.consumeStream=e.peekReadable=e.consumeReadable=e.newWriteableStream=e.isReadableBufferedStream=e.isReadableStream=e.isReadable=void 0;function A(y){const T=y;return T?typeof T.read=="function":!1}e.isReadable=A;function _(y){const T=y;return T?[T.on,T.pause,T.resume,T.destroy].every(t=>typeof t=="function"):!1}e.isReadableStream=_;function k(y){const T=y;return T?_(T.stream)&&Array.isArray(T.buffer)&&typeof T.ended=="boolean":!1}e.isReadableBufferedStream=k;function D(y,T){return new b(y,T)}e.newWriteableStream=D;class b{constructor(T,t){this.reducer=T,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(T){if(!this.state.destroyed){if(this.state.flowing)this.emitData(T);else if(this.buffer.data.push(T),typeof this.options?.highWaterMark=="number"&&this.buffer.data.length>this.options.highWaterMark)return new Promise(t=>this.pendingWritePromises.push(t))}}error(T){this.state.destroyed||(this.state.flowing?this.emitError(T):this.buffer.error.push(T))}end(T){this.state.destroyed||(typeof T<"u"&&this.write(T),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(T){this.listeners.data.slice(0).forEach(t=>t(T))}emitError(T){this.listeners.error.length===0?(0,I.onUnexpectedError)(T):this.listeners.error.slice(0).forEach(t=>t(T))}emitEnd(){this.listeners.end.slice(0).forEach(T=>T())}on(T,t){if(!this.state.destroyed)switch(T){case"data":this.listeners.data.push(t),this.resume();break;case"end":this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case"error":this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(T,t){if(this.state.destroyed)return;let o;switch(T){case"data":o=this.listeners.data;break;case"end":o=this.listeners.end;break;case"error":o=this.listeners.error;break}if(o){const n=o.indexOf(t);n>=0&&o.splice(n,1)}}flowData(){if(this.buffer.data.length>0){const T=this.reducer(this.buffer.data);this.emitData(T),this.buffer.data.length=0;const t=[...this.pendingWritePromises];this.pendingWritePromises.length=0,t.forEach(o=>o())}}flowErrors(){if(this.listeners.error.length>0){for(const T of this.buffer.error)this.emitError(T);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}}function S(y,T){const t=[];let o;for(;(o=y.read())!==null;)t.push(o);return T(t)}e.consumeReadable=S;function P(y,T,t){const o=[];let n;for(;(n=y.read())!==null&&o.length<t;)o.push(n);return n===null&&o.length>0?T(o):{read:()=>{if(o.length>0)return o.shift();if(typeof n<"u"){const s=n;return n=void 0,s}return y.read()}}}e.peekReadable=P;function p(y,T){return new Promise((t,o)=>{const n=[];g(y,{onData:s=>{T&&n.push(s)},onError:s=>{T?o(s):t(void 0)},onEnd:()=>{t(T?T(n):void 0)}})})}e.consumeStream=p;function g(y,T,t){y.on("error",o=>{t?.isCancellationRequested||T.onError(o)}),y.on("end",()=>{t?.isCancellationRequested||T.onEnd()}),y.on("data",o=>{t?.isCancellationRequested||T.onData(o)})}e.listenStream=g;function h(y,T){return new Promise((t,o)=>{const n=new O.DisposableStore,s=[],i=E=>{if(s.push(E),s.length>T)return n.dispose(),y.pause(),t({stream:y,buffer:s,ended:!1})},r=E=>o(E),a=()=>t({stream:y,buffer:s,ended:!0});n.add((0,O.toDisposable)(()=>y.removeListener("error",r))),y.on("error",r),n.add((0,O.toDisposable)(()=>y.removeListener("end",a))),y.on("end",a),n.add((0,O.toDisposable)(()=>y.removeListener("data",i))),y.on("data",i)})}e.peekStream=h;function f(y,T){const t=D(T);return t.end(y),t}e.toStream=f;function w(){const y=D(()=>{throw new Error("not supported")});return y.end(),y}e.emptyStream=w;function l(y){let T=!1;return{read:()=>T?null:(T=!0,y)}}e.toReadable=l;function d(y,T,t){const o=D(t);return g(y,{onData:n=>o.write(T.data(n)),onError:n=>o.error(T.error?T.error(n):n),onEnd:()=>o.end()}),o}e.transform=d;function c(y,T,t){let o=!1;return{read:()=>{const n=T.read();return o?n:(o=!0,n!==null?t([y,n]):y)}}}e.prefixedReadable=c;function m(y,T,t){let o=!1;const n=D(t);return g(T,{onData:s=>o?n.write(s):(o=!0,n.write(t([y,s]))),onError:s=>n.error(s),onEnd:()=>{o||(o=!0,n.write(y)),n.end()}}),n}e.prefixedStream=m}),define(ce[14],le([0,1,86,43]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.encodeBase64=e.decodeBase64=e.prefixedBufferStream=e.prefixedBufferReadable=e.newWriteableBufferStream=e.streamToBufferReadableStream=e.bufferToStream=e.bufferedStreamToBuffer=e.streamToBuffer=e.bufferToReadable=e.readableToBuffer=e.writeUInt8=e.readUInt8=e.writeUInt32LE=e.readUInt32LE=e.writeUInt32BE=e.readUInt32BE=e.writeUInt16LE=e.readUInt16LE=e.binaryIndexOf=e.VSBuffer=void 0;const A=typeof Buffer<"u",_=new I.Lazy(()=>new Uint8Array(256));let k,D;class b{static alloc(C){return A?new b(Buffer.allocUnsafe(C)):new b(new Uint8Array(C))}static wrap(C){return A&&!Buffer.isBuffer(C)&&(C=Buffer.from(C.buffer,C.byteOffset,C.byteLength)),new b(C)}static fromString(C,U){return!(U?.dontUseNodeBuffer||!1)&&A?new b(Buffer.from(C)):(k||(k=new TextEncoder),new b(k.encode(C)))}static fromByteArray(C){const U=b.alloc(C.length);for(let F=0,M=C.length;F<M;F++)U.buffer[F]=C[F];return U}static concat(C,U){if(typeof U>"u"){U=0;for(let z=0,V=C.length;z<V;z++)U+=C[z].byteLength}const F=b.alloc(U);let M=0;for(let z=0,V=C.length;z<V;z++){const J=C[z];F.set(J,M),M+=J.byteLength}return F}constructor(C){this.buffer=C,this.byteLength=this.buffer.byteLength}clone(){const C=b.alloc(this.byteLength);return C.set(this),C}toString(){return A?this.buffer.toString():(D||(D=new TextDecoder),D.decode(this.buffer))}slice(C,U){return new b(this.buffer.subarray(C,U))}set(C,U){if(C instanceof b)this.buffer.set(C.buffer,U);else if(C instanceof Uint8Array)this.buffer.set(C,U);else if(C instanceof ArrayBuffer)this.buffer.set(new Uint8Array(C),U);else if(ArrayBuffer.isView(C))this.buffer.set(new Uint8Array(C.buffer,C.byteOffset,C.byteLength),U);else throw new Error("Unknown argument 'array'")}readUInt32BE(C){return g(this.buffer,C)}writeUInt32BE(C,U){h(this.buffer,C,U)}readUInt32LE(C){return f(this.buffer,C)}writeUInt32LE(C,U){w(this.buffer,C,U)}readUInt8(C){return l(this.buffer,C)}writeUInt8(C,U){d(this.buffer,C,U)}indexOf(C,U=0){return S(this.buffer,C instanceof b?C.buffer:C,U)}}e.VSBuffer=b;function S(u,C,U=0){const F=C.byteLength,M=u.byteLength;if(F===0)return 0;if(F===1)return u.indexOf(C[0]);if(F>M-U)return-1;const z=_.value;z.fill(C.length);for(let Y=0;Y<C.length;Y++)z[C[Y]]=C.length-Y-1;let V=U+C.length-1,J=V,H=-1;for(;V<M;)if(u[V]===C[J]){if(J===0){H=V;break}V--,J--}else V+=Math.max(C.length-J,z[u[V]]),J=C.length-1;return H}e.binaryIndexOf=S;function P(u,C){return u[C+0]<<0>>>0|u[C+1]<<8>>>0}e.readUInt16LE=P;function p(u,C,U){u[U+0]=C&255,C=C>>>8,u[U+1]=C&255}e.writeUInt16LE=p;function g(u,C){return u[C]*2**24+u[C+1]*2**16+u[C+2]*2**8+u[C+3]}e.readUInt32BE=g;function h(u,C,U){u[U+3]=C,C=C>>>8,u[U+2]=C,C=C>>>8,u[U+1]=C,C=C>>>8,u[U]=C}e.writeUInt32BE=h;function f(u,C){return u[C+0]<<0>>>0|u[C+1]<<8>>>0|u[C+2]<<16>>>0|u[C+3]<<24>>>0}e.readUInt32LE=f;function w(u,C,U){u[U+0]=C&255,C=C>>>8,u[U+1]=C&255,C=C>>>8,u[U+2]=C&255,C=C>>>8,u[U+3]=C&255}e.writeUInt32LE=w;function l(u,C){return u[C]}e.readUInt8=l;function d(u,C,U){u[U]=C}e.writeUInt8=d;function c(u){return O.consumeReadable(u,C=>b.concat(C))}e.readableToBuffer=c;function m(u){return O.toReadable(u)}e.bufferToReadable=m;function y(u){return O.consumeStream(u,C=>b.concat(C))}e.streamToBuffer=y;async function T(u){return u.ended?b.concat(u.buffer):b.concat([...u.buffer,await y(u.stream)])}e.bufferedStreamToBuffer=T;function t(u){return O.toStream(u,C=>b.concat(C))}e.bufferToStream=t;function o(u){return O.transform(u,{data:C=>typeof C=="string"?b.fromString(C):b.wrap(C)},C=>b.concat(C))}e.streamToBufferReadableStream=o;function n(u){return O.newWriteableStream(C=>b.concat(C),u)}e.newWriteableBufferStream=n;function s(u,C){return O.prefixedReadable(u,C,U=>b.concat(U))}e.prefixedBufferReadable=s;function i(u,C){return O.prefixedStream(u,C,U=>b.concat(U))}e.prefixedBufferStream=i;function r(u){let C=0,U=0,F=0;const M=new Uint8Array(Math.floor(u.length/4*3)),z=J=>{switch(U){case 3:M[F++]=C|J,U=0;break;case 2:M[F++]=C|J>>>2,C=J<<6,U=3;break;case 1:M[F++]=C|J>>>4,C=J<<4,U=2;break;default:C=J<<2,U=1}};for(let J=0;J<u.length;J++){const H=u.charCodeAt(J);if(H>=65&&H<=90)z(H-65);else if(H>=97&&H<=122)z(H-97+26);else if(H>=48&&H<=57)z(H-48+52);else if(H===43||H===45)z(62);else if(H===47||H===95)z(63);else{if(H===61)break;throw new SyntaxError(`Unexpected base64 character ${u[J]}`)}}const V=F;for(;U>0;)z(0);return b.wrap(M).slice(0,V)}e.decodeBase64=r;const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function v({buffer:u},C=!0,U=!1){const F=U?E:a;let M="";const z=u.byteLength%3;let V=0;for(;V<u.byteLength-z;V+=3){const J=u[V+0],H=u[V+1],Y=u[V+2];M+=F[J>>>2],M+=F[(J<<4|H>>>4)&63],M+=F[(H<<2|Y>>>6)&63],M+=F[Y&63]}if(z===1){const J=u[V+0];M+=F[J>>>2],M+=F[J<<4&63],C&&(M+="==")}else if(z===2){const J=u[V+0],H=u[V+1];M+=F[J>>>2],M+=F[(J<<4|H>>>4)&63],M+=F[H<<2&63],C&&(M+="=")}return M}e.encodeBase64=v}),define(ce[28],le([0,1,128,86]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InvisibleCharacters=e.AmbiguousCharacters=e.noBreakWhitespace=e.getLeftDeleteOffset=e.GraphemeBreakType=e.getGraphemeBreakType=e.singleLetterHash=e.getNLines=e.uppercaseFirstLetter=e.containsUppercaseCharacter=e.fuzzyContains=e.repeat=e.stripUTF8BOM=e.startsWithUTF8BOM=e.UTF8_BOM_CHARACTER=e.removeAnsiEscapeCodes=e.lcut=e.isEmojiImprecise=e.isFullWidthCharacter=e.containsUnusualLineTerminators=e.UNUSUAL_LINE_TERMINATORS=e.isBasicASCII=e.containsRTL=e.charCount=e.getCharContainingOffset=e.prevCharLength=e.nextCharLength=e.GraphemeIterator=e.CodePointIterator=e.getNextCodePoint=e.computeCodePoint=e.isLowSurrogate=e.isHighSurrogate=e.commonSuffixLength=e.commonPrefixLength=e.startsWithIgnoreCase=e.equalsIgnoreCase=e.isUpperAsciiLetter=e.isLowerAsciiLetter=e.isAsciiDigit=e.compareSubstringIgnoreCase=e.compareIgnoreCase=e.compareSubstring=e.compare=e.replaceAsync=e.lastNonWhitespaceIndex=e.getLeadingWhitespace=e.firstNonWhitespaceIndex=e.splitLines=e.regExpLeadsToEndlessLoop=e.createRegExp=e.stripWildcards=e.convertSimple2RegExpPattern=e.rtrim=e.ltrim=e.trim=e.truncate=e.count=e.escapeRegExpCharacters=e.escape=e.format2=e.format=e.isFalsyOrWhitespace=void 0;function A(se){return!se||typeof se!="string"?!0:se.trim().length===0}e.isFalsyOrWhitespace=A;const _=/{(\d+)}/g;function k(se,...ge){return ge.length===0?se:se.replace(_,function(ve,we){const Pe=parseInt(we,10);return isNaN(Pe)||Pe<0||Pe>=ge.length?ve:ge[Pe]})}e.format=k;const D=/{([^}]+)}/g;function b(se,ge){return se.replace(D,(ve,we)=>ge[we]??ve)}e.format2=b;function S(se){return se.replace(/[<>&]/g,function(ge){switch(ge){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return ge}})}e.escape=S;function P(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}e.escapeRegExpCharacters=P;function p(se,ge){let ve=0;const we=ge.charCodeAt(0);for(let Pe=se.length-1;Pe>=0;Pe--)se.charCodeAt(Pe)===we&&ve++;return ve}e.count=p;function g(se,ge,ve="\u2026"){return se.length<=ge?se:`${se.substr(0,ge)}${ve}`}e.truncate=g;function h(se,ge=" "){const ve=f(se,ge);return w(ve,ge)}e.trim=h;function f(se,ge){if(!se||!ge)return se;const ve=ge.length;if(ve===0||se.length===0)return se;let we=0;for(;se.indexOf(ge,we)===we;)we=we+ve;return se.substring(we)}e.ltrim=f;function w(se,ge){if(!se||!ge)return se;const ve=ge.length,we=se.length;if(ve===0||we===0)return se;let Pe=we,be=-1;for(;be=se.lastIndexOf(ge,Pe-1),!(be===-1||be+ve!==Pe);){if(be===0)return"";Pe=be}return se.substring(0,Pe)}e.rtrim=w;function l(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}e.convertSimple2RegExpPattern=l;function d(se){return se.replace(/\*/g,"")}e.stripWildcards=d;function c(se,ge,ve={}){if(!se)throw new Error("Cannot create regex from empty string");ge||(se=P(se)),ve.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let we="";return ve.global&&(we+="g"),ve.matchCase||(we+="i"),ve.multiline&&(we+="m"),ve.unicode&&(we+="u"),new RegExp(se,we)}e.createRegExp=c;function m(se){return se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$"?!1:!!(se.exec("")&&se.lastIndex===0)}e.regExpLeadsToEndlessLoop=m;function y(se){return se.split(/\r\n|\r|\n/)}e.splitLines=y;function T(se){for(let ge=0,ve=se.length;ge<ve;ge++){const we=se.charCodeAt(ge);if(we!==32&&we!==9)return ge}return-1}e.firstNonWhitespaceIndex=T;function t(se,ge=0,ve=se.length){for(let we=ge;we<ve;we++){const Pe=se.charCodeAt(we);if(Pe!==32&&Pe!==9)return se.substring(ge,we)}return se.substring(ge,ve)}e.getLeadingWhitespace=t;function o(se,ge=se.length-1){for(let ve=ge;ve>=0;ve--){const we=se.charCodeAt(ve);if(we!==32&&we!==9)return ve}return-1}e.lastNonWhitespaceIndex=o;function n(se,ge,ve){const we=[];let Pe=0;for(const be of se.matchAll(ge)){if(we.push(se.slice(Pe,be.index)),be.index===void 0)throw new Error("match.index should be defined");Pe=be.index+be[0].length,we.push(ve(be[0],...be.slice(1),be.index,se,be.groups))}return we.push(se.slice(Pe)),Promise.all(we).then(be=>be.join(""))}e.replaceAsync=n;function s(se,ge){return se<ge?-1:se>ge?1:0}e.compare=s;function i(se,ge,ve=0,we=se.length,Pe=0,be=ge.length){for(;ve<we&&Pe<be;ve++,Pe++){const Ae=se.charCodeAt(ve),Ne=ge.charCodeAt(Pe);if(Ae<Ne)return-1;if(Ae>Ne)return 1}const Re=we-ve,Te=be-Pe;return Re<Te?-1:Re>Te?1:0}e.compareSubstring=i;function r(se,ge){return a(se,ge,0,se.length,0,ge.length)}e.compareIgnoreCase=r;function a(se,ge,ve=0,we=se.length,Pe=0,be=ge.length){for(;ve<we&&Pe<be;ve++,Pe++){let Ae=se.charCodeAt(ve),Ne=ge.charCodeAt(Pe);if(Ae===Ne)continue;if(Ae>=128||Ne>=128)return i(se.toLowerCase(),ge.toLowerCase(),ve,we,Pe,be);v(Ae)&&(Ae-=32),v(Ne)&&(Ne-=32);const We=Ae-Ne;if(We!==0)return We}const Re=we-ve,Te=be-Pe;return Re<Te?-1:Re>Te?1:0}e.compareSubstringIgnoreCase=a;function E(se){return se>=48&&se<=57}e.isAsciiDigit=E;function v(se){return se>=97&&se<=122}e.isLowerAsciiLetter=v;function u(se){return se>=65&&se<=90}e.isUpperAsciiLetter=u;function C(se,ge){return se.length===ge.length&&a(se,ge)===0}e.equalsIgnoreCase=C;function U(se,ge){const ve=ge.length;return ge.length>se.length?!1:a(se,ge,0,ve)===0}e.startsWithIgnoreCase=U;function F(se,ge){const ve=Math.min(se.length,ge.length);let we;for(we=0;we<ve;we++)if(se.charCodeAt(we)!==ge.charCodeAt(we))return we;return ve}e.commonPrefixLength=F;function M(se,ge){const ve=Math.min(se.length,ge.length);let we;const Pe=se.length-1,be=ge.length-1;for(we=0;we<ve;we++)if(se.charCodeAt(Pe-we)!==ge.charCodeAt(be-we))return we;return ve}e.commonSuffixLength=M;function z(se){return 55296<=se&&se<=56319}e.isHighSurrogate=z;function V(se){return 56320<=se&&se<=57343}e.isLowSurrogate=V;function J(se,ge){return(se-55296<<10)+(ge-56320)+65536}e.computeCodePoint=J;function H(se,ge,ve){const we=se.charCodeAt(ve);if(z(we)&&ve+1<ge){const Pe=se.charCodeAt(ve+1);if(V(Pe))return J(we,Pe)}return we}e.getNextCodePoint=H;function Y(se,ge){const ve=se.charCodeAt(ge-1);if(V(ve)&&ge>1){const we=se.charCodeAt(ge-2);if(z(we))return J(we,ve)}return ve}class B{get offset(){return this._offset}constructor(ge,ve=0){this._str=ge,this._len=ge.length,this._offset=ve}setOffset(ge){this._offset=ge}prevCodePoint(){const ge=Y(this._str,this._offset);return this._offset-=ge>=65536?2:1,ge}nextCodePoint(){const ge=H(this._str,this._len,this._offset);return this._offset+=ge>=65536?2:1,ge}eol(){return this._offset>=this._len}}e.CodePointIterator=B;class K{get offset(){return this._iterator.offset}constructor(ge,ve=0){this._iterator=new B(ge,ve)}nextGraphemeLength(){const ge=Se.getInstance(),ve=this._iterator,we=ve.offset;let Pe=ge.getGraphemeBreakType(ve.nextCodePoint());for(;!ve.eol();){const be=ve.offset,Re=ge.getGraphemeBreakType(ve.nextCodePoint());if(he(Pe,Re)){ve.setOffset(be);break}Pe=Re}return ve.offset-we}prevGraphemeLength(){const ge=Se.getInstance(),ve=this._iterator,we=ve.offset;let Pe=ge.getGraphemeBreakType(ve.prevCodePoint());for(;ve.offset>0;){const be=ve.offset,Re=ge.getGraphemeBreakType(ve.prevCodePoint());if(he(Re,Pe)){ve.setOffset(be);break}Pe=Re}return we-ve.offset}eol(){return this._iterator.eol()}}e.GraphemeIterator=K;function x(se,ge){return new K(se,ge).nextGraphemeLength()}e.nextCharLength=x;function q(se,ge){return new K(se,ge).prevGraphemeLength()}e.prevCharLength=q;function j(se,ge){ge>0&&V(se.charCodeAt(ge))&&ge--;const ve=ge+x(se,ge);return[ve-q(se,ve),ve]}e.getCharContainingOffset=j;function Z(se){const ge=new K(se);let ve=0;for(;!ge.eol();)ve++,ge.nextGraphemeLength();return ve}e.charCount=Z;let oe;function ue(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function ae(se){return oe||(oe=ue()),oe.test(se)}e.containsRTL=ae;const $=/^[\t\n\r\x20-\x7E]*$/;function R(se){return $.test(se)}e.isBasicASCII=R,e.UNUSUAL_LINE_TERMINATORS=/[\u2028\u2029]/;function L(se){return e.UNUSUAL_LINE_TERMINATORS.test(se)}e.containsUnusualLineTerminators=L;function N(se){return se>=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}e.isFullWidthCharacter=N;function W(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129008||se>=129280&&se<=129535||se>=129648&&se<=129782}e.isEmojiImprecise=W;function X(se,ge){if(se.length<ge)return se;const ve=/\b/g;let we=0;for(;ve.test(se)&&!(se.length-ve.lastIndex<ge);)we=ve.lastIndex,ve.lastIndex+=1;return se.substring(we).replace(/^\s/,"")}e.lcut=X;const ne=/(:?\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/g,re=/\x1b\].*?\x07/g;function Q(se){return se&&(se=se.replace(ne,"").replace(re,"")),se}e.removeAnsiEscapeCodes=Q,e.UTF8_BOM_CHARACTER=String.fromCharCode(65279);function ee(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}e.startsWithUTF8BOM=ee;function ie(se){return ee(se)?se.substr(1):se}e.stripUTF8BOM=ie;function de(se,ge){let ve="";for(let we=0;we<ge;we++)ve+=se;return ve}e.repeat=de;function fe(se,ge){if(!se||!ge||se.length<ge.length)return!1;const ve=ge.length,we=se.toLowerCase();let Pe=0,be=-1;for(;Pe<ve;){const Re=we.indexOf(ge[Pe],be+1);if(Re<0)return!1;be=Re,Pe++}return!0}e.fuzzyContains=fe;function pe(se,ge=!1){return se?(ge&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}e.containsUppercaseCharacter=pe;function ye(se){return se.charAt(0).toUpperCase()+se.slice(1)}e.uppercaseFirstLetter=ye;function De(se,ge=1){if(ge===0)return"";let ve=-1;do ve=se.indexOf(`
`,ve+1),ge--;while(ge>0&&ve>=0);return ve===-1?se:(se[ve-1]==="\r"&&ve--,se.substr(0,ve))}e.getNLines=De;function ke(se){return se=se%(2*26),se<26?String.fromCharCode(97+se):String.fromCharCode(65+se-26)}e.singleLetterHash=ke;function Ue(se){return Se.getInstance().getGraphemeBreakType(se)}e.getGraphemeBreakType=Ue;function he(se,ge){return se===0?ge!==5&&ge!==7:se===2&&ge===3?!1:se===4||se===2||se===3||ge===4||ge===2||ge===3?!0:!(se===8&&(ge===8||ge===9||ge===11||ge===12)||(se===11||se===9)&&(ge===9||ge===10)||(se===12||se===10)&&ge===10||ge===5||ge===13||ge===7||se===1||se===13&&ge===14||se===6&&ge===6)}var me;(function(se){se[se.Other=0]="Other",se[se.Prepend=1]="Prepend",se[se.CR=2]="CR",se[se.LF=3]="LF",se[se.Control=4]="Control",se[se.Extend=5]="Extend",se[se.Regional_Indicator=6]="Regional_Indicator",se[se.SpacingMark=7]="SpacingMark",se[se.L=8]="L",se[se.V=9]="V",se[se.T=10]="T",se[se.LV=11]="LV",se[se.LVT=12]="LVT",se[se.ZWJ=13]="ZWJ",se[se.Extended_Pictographic=14]="Extended_Pictographic"})(me||(e.GraphemeBreakType=me={}));class Se{static{this._INSTANCE=null}static getInstance(){return Se._INSTANCE||(Se._INSTANCE=new Se),Se._INSTANCE}constructor(){this._data=Ie()}getGraphemeBreakType(ge){if(ge<32)return ge===10?3:ge===13?2:4;if(ge<127)return 0;const ve=this._data,we=ve.length/3;let Pe=1;for(;Pe<=we;)if(ge<ve[3*Pe])Pe=2*Pe;else if(ge>ve[3*Pe+1])Pe=2*Pe+1;else return ve[3*Pe+2];return 0}}function Ie(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function Le(se,ge){if(se===0)return 0;const ve=$e(se,ge);if(ve!==void 0)return ve;const we=new B(ge,se);return we.prevCodePoint(),we.offset}e.getLeftDeleteOffset=Le;function $e(se,ge){const ve=new B(ge,se);let we=ve.prevCodePoint();for(;_e(we)||we===65039||we===8419;){if(ve.offset===0)return;we=ve.prevCodePoint()}if(!W(we))return;let Pe=ve.offset;return Pe>0&&ve.prevCodePoint()===8205&&(Pe=ve.offset),Pe}function _e(se){return 127995<=se&&se<=127999}var ze;(function(se){se[se.zwj=8205]="zwj",se[se.emojiVariantSelector=65039]="emojiVariantSelector",se[se.enclosingKeyCap=8419]="enclosingKeyCap"})(ze||(ze={})),e.noBreakWhitespace="\xA0";class Oe{static{this.ambiguousCharacterData=new O.Lazy(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))}static{this.cache=new I.LRUCachedFunction(ge=>{function ve(We){const je=new Map;for(let qe=0;qe<We.length;qe+=2)je.set(We[qe],We[qe+1]);return je}function we(We,je){const qe=new Map(We);for(const[Je,Qe]of je)qe.set(Je,Qe);return qe}function Pe(We,je){if(!We)return je;const qe=new Map;for(const[Je,Qe]of We)je.has(Je)&&qe.set(Je,Qe);return qe}const be=this.ambiguousCharacterData.value;let Re=ge.filter(We=>!We.startsWith("_")&&We in be);Re.length===0&&(Re=["_default"]);let Te;for(const We of Re){const je=ve(be[We]);Te=Pe(Te,je)}const Ae=ve(be._common),Ne=we(Ae,Te);return new Oe(Ne)})}static getInstance(ge){return Oe.cache.get(Array.from(ge))}static{this._locales=new O.Lazy(()=>Object.keys(Oe.ambiguousCharacterData.value).filter(ge=>!ge.startsWith("_")))}static getLocales(){return Oe._locales.value}constructor(ge){this.confusableDictionary=ge}isAmbiguous(ge){return this.confusableDictionary.has(ge)}getPrimaryConfusable(ge){return this.confusableDictionary.get(ge)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}e.AmbiguousCharacters=Oe;class Me{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static{this._data=void 0}static getData(){return this._data||(this._data=new Set(Me.getRawData())),this._data}static isInvisibleCharacter(ge){return Me.getData().has(ge)}static get codePoints(){return Me.getData()}}e.InvisibleCharacters=Me}),define(ce[51],le([0,1,28]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StringSHA1=e.toHexString=e.Hasher=e.stringHash=e.numberHash=e.doHash=e.hash=void 0;function O(d){return A(d,0)}e.hash=O;function A(d,c){switch(typeof d){case"object":return d===null?_(349,c):Array.isArray(d)?b(d,c):S(d,c);case"string":return D(d,c);case"boolean":return k(d,c);case"number":return _(d,c);case"undefined":return _(937,c);default:return _(617,c)}}e.doHash=A;function _(d,c){return(c<<5)-c+d|0}e.numberHash=_;function k(d,c){return _(d?433:863,c)}function D(d,c){c=_(149417,c);for(let m=0,y=d.length;m<y;m++)c=_(d.charCodeAt(m),c);return c}e.stringHash=D;function b(d,c){return c=_(104579,c),d.reduce((m,y)=>A(y,m),c)}function S(d,c){return c=_(181387,c),Object.keys(d).sort().reduce((m,y)=>(m=D(y,m),A(d[y],m)),c)}class P{constructor(){this._value=0}get value(){return this._value}hash(c){return this._value=A(c,this._value),this._value}}e.Hasher=P;var p;(function(d){d[d.BLOCK_SIZE=64]="BLOCK_SIZE",d[d.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(p||(p={}));function g(d,c,m=32){const y=m-c,T=~((1<<y)-1);return(d<<c|(T&d)>>>y)>>>0}function h(d,c=0,m=d.byteLength,y=0){for(let T=0;T<m;T++)d[c+T]=y}function f(d,c,m="0"){for(;d.length<c;)d=m+d;return d}function w(d,c=32){return d instanceof ArrayBuffer?Array.from(new Uint8Array(d)).map(m=>m.toString(16).padStart(2,"0")).join(""):f((d>>>0).toString(16),c/4)}e.toHexString=w;class l{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(c){const m=c.length;if(m===0)return;const y=this._buff;let T=this._buffLen,t=this._leftoverHighSurrogate,o,n;for(t!==0?(o=t,n=-1,t=0):(o=c.charCodeAt(0),n=0);;){let s=o;if(I.isHighSurrogate(o))if(n+1<m){const i=c.charCodeAt(n+1);I.isLowSurrogate(i)?(n++,s=I.computeCodePoint(o,i)):s=65533}else{t=o;break}else I.isLowSurrogate(o)&&(s=65533);if(T=this._push(y,T,s),n++,n<m)o=c.charCodeAt(n);else break}this._buffLen=T,this._leftoverHighSurrogate=t}_push(c,m,y){return y<128?c[m++]=y:y<2048?(c[m++]=192|(y&1984)>>>6,c[m++]=128|(y&63)>>>0):y<65536?(c[m++]=224|(y&61440)>>>12,c[m++]=128|(y&4032)>>>6,c[m++]=128|(y&63)>>>0):(c[m++]=240|(y&1835008)>>>18,c[m++]=128|(y&258048)>>>12,c[m++]=128|(y&4032)>>>6,c[m++]=128|(y&63)>>>0),m>=64&&(this._step(),m-=64,this._totalLen+=64,c[0]=c[64+0],c[1]=c[64+1],c[2]=c[64+2]),m}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),w(this._h0)+w(this._h1)+w(this._h2)+w(this._h3)+w(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,h(this._buff,this._buffLen),this._buffLen>56&&(this._step(),h(this._buff));const c=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(c/4294967296),!1),this._buffDV.setUint32(60,c%4294967296,!1),this._step()}_step(){const c=l._bigBlock32,m=this._buffDV;for(let a=0;a<64;a+=4)c.setUint32(a,m.getUint32(a,!1),!1);for(let a=64;a<320;a+=4)c.setUint32(a,g(c.getUint32(a-12,!1)^c.getUint32(a-32,!1)^c.getUint32(a-56,!1)^c.getUint32(a-64,!1),1),!1);let y=this._h0,T=this._h1,t=this._h2,o=this._h3,n=this._h4,s,i,r;for(let a=0;a<80;a++)a<20?(s=T&t|~T&o,i=1518500249):a<40?(s=T^t^o,i=1859775393):a<60?(s=T&t|T&o|t&o,i=2400959708):(s=T^t^o,i=3395469782),r=g(y,5)+s+n+i+c.getUint32(a*4,!1)&4294967295,n=o,o=t,t=g(T,30),T=y,y=r;this._h0=this._h0+y&4294967295,this._h1=this._h1+T&4294967295,this._h2=this._h2+t&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+n&4294967295}}e.StringSHA1=l}),define(ce[90],le([0,1,28]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var O;(function(A){A[A.Ignore=0]="Ignore",A[A.Info=1]="Info",A[A.Warning=2]="Warning",A[A.Error=3]="Error"})(O||(O={})),function(A){const _="error",k="warning",D="warn",b="info",S="ignore";function P(g){return g?I.equalsIgnoreCase(_,g)?A.Error:I.equalsIgnoreCase(k,g)||I.equalsIgnoreCase(D,g)?A.Warning:I.equalsIgnoreCase(b,g)?A.Info:A.Ignore:A.Ignore}A.fromValue=P;function p(g){switch(g){case A.Error:return _;case A.Warning:return k;case A.Info:return b;default:return S}}A.toString=p}(O||(O={})),e.default=O}),define(ce[129],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MicrotaskDelay=void 0,e.MicrotaskDelay=Symbol("MicrotaskDelay")}),define(ce[47],le([0,1,20,28]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TernarySearchTree=e.UriIterator=e.PathIterator=e.ConfigKeysIterator=e.StringIterator=void 0;class A{constructor(){this._value="",this._pos=0}reset(h){return this._value=h,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(h){const f=h.charCodeAt(0),w=this._value.charCodeAt(this._pos);return f-w}value(){return this._value[this._pos]}}e.StringIterator=A;class _{constructor(h=!0){this._caseSensitive=h}reset(h){return this._value=h,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let h=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===46)if(h)this._from++;else break;else h=!1;return this}cmp(h){return this._caseSensitive?(0,O.compareSubstring)(h,this._value,0,h.length,this._from,this._to):(0,O.compareSubstringIgnoreCase)(h,this._value,0,h.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.ConfigKeysIterator=_;class k{constructor(h=!0,f=!0){this._splitOnBackslash=h,this._caseSensitive=f}reset(h){this._from=0,this._to=0,this._value=h,this._valueLen=h.length;for(let f=h.length-1;f>=0;f--,this._valueLen--){const w=this._value.charCodeAt(f);if(!(w===47||this._splitOnBackslash&&w===92))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let h=!0;for(;this._to<this._valueLen;this._to++){const f=this._value.charCodeAt(this._to);if(f===47||this._splitOnBackslash&&f===92)if(h)this._from++;else break;else h=!1}return this}cmp(h){return this._caseSensitive?(0,O.compareSubstring)(h,this._value,0,h.length,this._from,this._to):(0,O.compareSubstringIgnoreCase)(h,this._value,0,h.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}e.PathIterator=k;var D;(function(g){g[g.Scheme=1]="Scheme",g[g.Authority=2]="Authority",g[g.Path=3]="Path",g[g.Query=4]="Query",g[g.Fragment=5]="Fragment"})(D||(D={}));class b{constructor(h,f){this._ignorePathCasing=h,this._ignoreQueryAndFragment=f,this._states=[],this._stateIdx=0}reset(h){return this._value=h,this._states=[],this._value.scheme&&this._states.push(1),this._value.authority&&this._states.push(2),this._value.path&&(this._pathIterator=new k(!1,!this._ignorePathCasing(h)),this._pathIterator.reset(h.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(h)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(h){if(this._states[this._stateIdx]===1)return(0,O.compareIgnoreCase)(h,this._value.scheme);if(this._states[this._stateIdx]===2)return(0,O.compareIgnoreCase)(h,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(h);if(this._states[this._stateIdx]===4)return(0,O.compare)(h,this._value.query);if(this._states[this._stateIdx]===5)return(0,O.compare)(h,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}e.UriIterator=b;class S{constructor(){this.height=1}isEmpty(){return!this.left&&!this.mid&&!this.right&&!this.value}rotateLeft(){const h=this.right;return this.right=h.left,h.left=this,this.updateHeight(),h.updateHeight(),h}rotateRight(){const h=this.left;return this.left=h.right,h.right=this,this.updateHeight(),h.updateHeight(),h}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}var P;(function(g){g[g.Left=-1]="Left",g[g.Mid=0]="Mid",g[g.Right=1]="Right"})(P||(P={}));class p{static forUris(h=()=>!1,f=()=>!1){return new p(new b(h,f))}static forPaths(h=!1){return new p(new k(void 0,!h))}static forStrings(){return new p(new A)}static forConfigKeys(){return new p(new _)}constructor(h){this._iter=h}clear(){this._root=void 0}fill(h,f){if(f){const w=f.slice(0);(0,I.shuffle)(w);for(const l of w)this.set(l,h)}else{const w=h.slice(0);(0,I.shuffle)(w);for(const l of w)this.set(l[0],l[1])}}set(h,f){const w=this._iter.reset(h);let l;this._root||(this._root=new S,this._root.segment=w.value());const d=[];for(l=this._root;;){const m=w.cmp(l.segment);if(m>0)l.left||(l.left=new S,l.left.segment=w.value()),d.push([-1,l]),l=l.left;else if(m<0)l.right||(l.right=new S,l.right.segment=w.value()),d.push([1,l]),l=l.right;else if(w.hasNext())w.next(),l.mid||(l.mid=new S,l.mid.segment=w.value()),d.push([0,l]),l=l.mid;else break}const c=l.value;l.value=f,l.key=h;for(let m=d.length-1;m>=0;m--){const y=d[m][1];y.updateHeight();const T=y.balanceFactor();if(T<-1||T>1){const t=d[m][0],o=d[m+1][0];if(t===1&&o===1)d[m][1]=y.rotateLeft();else if(t===-1&&o===-1)d[m][1]=y.rotateRight();else if(t===1&&o===-1)y.right=d[m+1][1]=d[m+1][1].rotateRight(),d[m][1]=y.rotateLeft();else if(t===-1&&o===1)y.left=d[m+1][1]=d[m+1][1].rotateLeft(),d[m][1]=y.rotateRight();else throw new Error;if(m>0)switch(d[m-1][0]){case-1:d[m-1][1].left=d[m][1];break;case 1:d[m-1][1].right=d[m][1];break;case 0:d[m-1][1].mid=d[m][1];break}else this._root=d[0][1]}}return c}get(h){return this._getNode(h)?.value}_getNode(h){const f=this._iter.reset(h);let w=this._root;for(;w;){const l=f.cmp(w.segment);if(l>0)w=w.left;else if(l<0)w=w.right;else if(f.hasNext())f.next(),w=w.mid;else break}return w}has(h){const f=this._getNode(h);return!(f?.value===void 0&&f?.mid===void 0)}delete(h){return this._delete(h,!1)}deleteSuperstr(h){return this._delete(h,!0)}_delete(h,f){const w=this._iter.reset(h),l=[];let d=this._root;for(;d;){const c=w.cmp(d.segment);if(c>0)l.push([-1,d]),d=d.left;else if(c<0)l.push([1,d]),d=d.right;else if(w.hasNext())w.next(),l.push([0,d]),d=d.mid;else break}if(d){if(f?(d.left=void 0,d.mid=void 0,d.right=void 0,d.height=1):(d.key=void 0,d.value=void 0),!d.mid&&!d.value)if(d.left&&d.right){const c=this._min(d.right);if(c.key){const{key:m,value:y,segment:T}=c;this._delete(c.key,!1),d.key=m,d.value=y,d.segment=T}}else{const c=d.left??d.right;if(l.length>0){const[m,y]=l[l.length-1];switch(m){case-1:y.left=c;break;case 0:y.mid=c;break;case 1:y.right=c;break}}else this._root=c}for(let c=l.length-1;c>=0;c--){const m=l[c][1];m.updateHeight();const y=m.balanceFactor();if(y>1?(m.right.balanceFactor()>=0||(m.right=m.right.rotateRight()),l[c][1]=m.rotateLeft()):y<-1&&(m.left.balanceFactor()<=0||(m.left=m.left.rotateLeft()),l[c][1]=m.rotateRight()),c>0)switch(l[c-1][0]){case-1:l[c-1][1].left=l[c][1];break;case 1:l[c-1][1].right=l[c][1];break;case 0:l[c-1][1].mid=l[c][1];break}else this._root=l[0][1]}}}_min(h){for(;h.left;)h=h.left;return h}findSubstr(h){const f=this._iter.reset(h);let w=this._root,l;for(;w;){const d=f.cmp(w.segment);if(d>0)w=w.left;else if(d<0)w=w.right;else if(f.hasNext())f.next(),l=w.value||l,w=w.mid;else break}return w&&w.value||l}findSuperstr(h){return this._findSuperstrOrElement(h,!1)}_findSuperstrOrElement(h,f){const w=this._iter.reset(h);let l=this._root;for(;l;){const d=w.cmp(l.segment);if(d>0)l=l.left;else if(d<0)l=l.right;else if(w.hasNext())w.next(),l=l.mid;else return l.mid?this._entries(l.mid):f?l.value:void 0}}hasElementOrSubtree(h){return this._findSuperstrOrElement(h,!0)!==void 0}forEach(h){for(const[f,w]of this)h(w,f)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(h){const f=[];return this._dfsEntries(h,f),f[Symbol.iterator]()}_dfsEntries(h,f){h&&(h.left&&this._dfsEntries(h.left,f),h.value&&f.push([h.key,h.value]),h.mid&&this._dfsEntries(h.mid,f),h.right&&this._dfsEntries(h.right,f))}_isBalanced(){const h=f=>{if(!f)return!0;const w=f.balanceFactor();return w<-1||w>1?!1:h(f.left)&&h(f.right)};return h(this._root)}}e.TernarySearchTree=p}),define(ce[12],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.withNullAsUndefined=e.validateConstraint=e.validateConstraints=e.areFunctions=e.isFunction=e.isEmptyObject=e.assertAllDefined=e.assertIsDefined=e.assertType=e.isUndefinedOrNull=e.isDefined=e.isUndefined=e.isBoolean=e.isIterable=e.isNumber=e.isTypedArray=e.isObject=e.isStringArray=e.isString=void 0;function I(t){return typeof t=="string"}e.isString=I;function O(t){return Array.isArray(t)&&t.every(o=>I(o))}e.isStringArray=O;function A(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}e.isObject=A;function _(t){const o=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof o}e.isTypedArray=_;function k(t){return typeof t=="number"&&!isNaN(t)}e.isNumber=k;function D(t){return!!t&&typeof t[Symbol.iterator]=="function"}e.isIterable=D;function b(t){return t===!0||t===!1}e.isBoolean=b;function S(t){return typeof t>"u"}e.isUndefined=S;function P(t){return!p(t)}e.isDefined=P;function p(t){return S(t)||t===null}e.isUndefinedOrNull=p;function g(t,o){if(!t)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}e.assertType=g;function h(t){if(p(t))throw new Error("Assertion Failed: argument is undefined or null");return t}e.assertIsDefined=h;function f(...t){const o=[];for(let n=0;n<t.length;n++){const s=t[n];if(p(s))throw new Error(`Assertion Failed: argument at index ${n} is undefined or null`);o.push(s)}return o}e.assertAllDefined=f;const w=Object.prototype.hasOwnProperty;function l(t){if(!A(t))return!1;for(const o in t)if(w.call(t,o))return!1;return!0}e.isEmptyObject=l;function d(t){return typeof t=="function"}e.isFunction=d;function c(...t){return t.length>0&&t.every(d)}e.areFunctions=c;function m(t,o){const n=Math.min(t.length,o.length);for(let s=0;s<n;s++)y(t[s],o[s])}e.validateConstraints=m;function y(t,o){if(I(o)){if(typeof t!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(d(o)){try{if(t instanceof o)return}catch{}if(!p(t)&&t.constructor===o||o.length===1&&o.call(void 0,t)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}e.validateConstraint=y;function T(t){return t===null?void 0:t}e.withNullAsUndefined=T}),define(ce[30],le([0,1,12]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createProxyObject=e.getAllMethodNames=e.getAllPropertyNames=e.filter=e.getCaseInsensitive=e.distinct=e.getOrDefault=e.safeStringify=e.equals=e.mixin=e.cloneAndChange=e.deepFreeze=e.deepClone=void 0;function O(c){if(!c||typeof c!="object"||c instanceof RegExp)return c;const m=Array.isArray(c)?[]:{};return Object.entries(c).forEach(([y,T])=>{m[y]=T&&typeof T=="object"?O(T):T}),m}e.deepClone=O;function A(c){if(!c||typeof c!="object")return c;const m=[c];for(;m.length>0;){const y=m.shift();Object.freeze(y);for(const T in y)if(_.call(y,T)){const t=y[T];typeof t=="object"&&!Object.isFrozen(t)&&!(0,I.isTypedArray)(t)&&m.push(t)}}return c}e.deepFreeze=A;const _=Object.prototype.hasOwnProperty;function k(c,m){return D(c,m,new Set)}e.cloneAndChange=k;function D(c,m,y){if((0,I.isUndefinedOrNull)(c))return c;const T=m(c);if(typeof T<"u")return T;if(Array.isArray(c)){const t=[];for(const o of c)t.push(D(o,m,y));return t}if((0,I.isObject)(c)){if(y.has(c))throw new Error("Cannot clone recursive data-structure");y.add(c);const t={};for(const o in c)_.call(c,o)&&(t[o]=D(c[o],m,y));return y.delete(c),t}return c}function b(c,m,y=!0){return(0,I.isObject)(c)?((0,I.isObject)(m)&&Object.keys(m).forEach(T=>{T in c?y&&((0,I.isObject)(c[T])&&(0,I.isObject)(m[T])?b(c[T],m[T],y):c[T]=m[T]):c[T]=m[T]}),c):m}e.mixin=b;function S(c,m){if(c===m)return!0;if(c==null||m===null||m===void 0||typeof c!=typeof m||typeof c!="object"||Array.isArray(c)!==Array.isArray(m))return!1;let y,T;if(Array.isArray(c)){if(c.length!==m.length)return!1;for(y=0;y<c.length;y++)if(!S(c[y],m[y]))return!1}else{const t=[];for(T in c)t.push(T);t.sort();const o=[];for(T in m)o.push(T);if(o.sort(),!S(t,o))return!1;for(y=0;y<t.length;y++)if(!S(c[t[y]],m[t[y]]))return!1}return!0}e.equals=S;function P(c){const m=new Set;return JSON.stringify(c,(y,T)=>{if((0,I.isObject)(T)||Array.isArray(T)){if(m.has(T))return"[Circular]";m.add(T)}return T})}e.safeStringify=P;function p(c,m,y){const T=m(c);return typeof T>"u"?y:T}e.getOrDefault=p;function g(c,m){const y=Object.create(null);return!c||!m||Object.keys(m).forEach(t=>{const o=c[t],n=m[t];S(o,n)||(y[t]=n)}),y}e.distinct=g;function h(c,m){const y=m.toLowerCase(),T=Object.keys(c).find(t=>t.toLowerCase()===y);return T?c[T]:c[m]}e.getCaseInsensitive=h;function f(c,m){const y=Object.create(null);for(const[T,t]of Object.entries(c))m(T,t)&&(y[T]=t);return y}e.filter=f;function w(c){let m=[];for(;Object.prototype!==c;)m=m.concat(Object.getOwnPropertyNames(c)),c=Object.getPrototypeOf(c);return m}e.getAllPropertyNames=w;function l(c){const m=[];for(const y of w(c))typeof c[y]=="function"&&m.push(y);return m}e.getAllMethodNames=l;function d(c,m){const y=t=>function(){const o=Array.prototype.slice.call(arguments,0);return m(t,o)},T={};for(const t of c)T[t]=y(t);return T}e.createProxyObject=d}),define(ce[32],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=e.isUUID=void 0;const I=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function O(A){return I.test(A)}e.isUUID=O,e.generateUuid=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let A;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?A=crypto.getRandomValues.bind(crypto):A=function(D){for(let b=0;b<D.length;b++)D[b]=Math.floor(Math.random()*256);return D};const _=new Uint8Array(16),k=[];for(let D=0;D<256;D++)k.push(D.toString(16).padStart(2,"0"));return function(){A(_),_[6]=_[6]&15|64,_[8]=_[8]&63|128;let b=0,S="";return S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S+="-",S+=k[_[b++]],S+=k[_[b++]],S+="-",S+=k[_[b++]],S+=k[_[b++]],S+="-",S+=k[_[b++]],S+=k[_[b++]],S+="-",S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S+=k[_[b++]],S}}()}),define(ce[130],le([0,1,36]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMac=void 0;const O=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function A(k){const D=k.replace(/\-/g,":").toLowerCase();return!O.has(D)}function _(){const k=(0,I.networkInterfaces)();for(const D in k){const b=k[D];if(b){for(const{mac:S}of b)if(A(S))return S}}throw new Error("Unable to retrieve mac address (unexpected format)")}e.getMac=_}),define(ce[131],le([0,1,36,47,32,130]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getMachineId=e.virtualMachineHint=void 0,e.virtualMachineHint=new class{_isVirtualMachineMacAddress(S){return this._virtualMachineOUIs||(this._virtualMachineOUIs=O.TernarySearchTree.forStrings(),this._virtualMachineOUIs.set("00-50-56",!0),this._virtualMachineOUIs.set("00-0C-29",!0),this._virtualMachineOUIs.set("00-05-69",!0),this._virtualMachineOUIs.set("00-03-FF",!0),this._virtualMachineOUIs.set("00-1C-42",!0),this._virtualMachineOUIs.set("00-16-3E",!0),this._virtualMachineOUIs.set("08-00-27",!0),this._virtualMachineOUIs.set("00:50:56",!0),this._virtualMachineOUIs.set("00:0C:29",!0),this._virtualMachineOUIs.set("00:05:69",!0),this._virtualMachineOUIs.set("00:03:FF",!0),this._virtualMachineOUIs.set("00:1C:42",!0),this._virtualMachineOUIs.set("00:16:3E",!0),this._virtualMachineOUIs.set("08:00:27",!0)),!!this._virtualMachineOUIs.findSubstr(S)}value(){if(this._value===void 0){let S=0,P=0;const p=(0,I.networkInterfaces)();for(const g in p){const h=p[g];if(h)for(const{mac:f,internal:w}of h)w||(P+=1,this._isVirtualMachineMacAddress(f.toUpperCase())&&(S+=1))}this._value=P>0?S/P:0}return this._value}};let k;async function D(S){return k||(k=(async()=>await b(S)||A.generateUuid())()),k}e.getMachineId=D;async function b(S){try{const P=await new Promise((g,h)=>{te(["crypto"],g,h)}),p=(0,_.getMac)();return P.createHash("sha256").update(p,"utf8").digest("hex")}catch(P){S(P);return}}}),define(ce[132],le([0,1,268,14]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StreamSplitter=void 0;class A extends I.Transform{constructor(k){if(super(),typeof k=="number")this.splitter=k,this.spitterLen=1;else{const D=Buffer.isBuffer(k)?k:Buffer.from(k);this.splitter=D.length===1?D[0]:D,this.spitterLen=D.length}}_transform(k,D,b){this.buffer?this.buffer=Buffer.concat([this.buffer,k]):this.buffer=k;let S=0;for(;S<this.buffer.length;){const P=typeof this.splitter=="number"?this.buffer.indexOf(this.splitter,S):(0,O.binaryIndexOf)(this.buffer,this.splitter,S);if(P===-1)break;this.push(this.buffer.slice(S,P+this.spitterLen)),S=P+this.spitterLen}this.buffer=S===this.buffer.length?void 0:this.buffer.slice(S),b()}_flush(k){this.buffer&&this.push(this.buffer),k()}}e.StreamSplitter=A}),define(ce[133],le([0,1,60]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findFreePortFaster=e.BROWSER_RESTRICTED_PORTS=e.findFreePort=void 0;function O(D,b,S,P=1){let p=!1;return new Promise(g=>{const h=setTimeout(()=>{if(!p)return p=!0,g(0)},S);A(D,b,P,f=>{if(!p)return p=!0,clearTimeout(h),g(f)})})}e.findFreePort=O;function A(D,b,S,P){if(b===0)return P(0);const p=new I.Socket;p.once("connect",()=>(k(p),A(D+S,b-1,S,P))),p.once("data",()=>{}),p.once("error",g=>(k(p),g.code!=="ECONNREFUSED"?A(D+S,b-1,S,P):P(D))),p.connect(D,"127.0.0.1")}e.BROWSER_RESTRICTED_PORTS={1:!0,7:!0,9:!0,11:!0,13:!0,15:!0,17:!0,19:!0,20:!0,21:!0,22:!0,23:!0,25:!0,37:!0,42:!0,43:!0,53:!0,69:!0,77:!0,79:!0,87:!0,95:!0,101:!0,102:!0,103:!0,104:!0,109:!0,110:!0,111:!0,113:!0,115:!0,117:!0,119:!0,123:!0,135:!0,137:!0,139:!0,143:!0,161:!0,179:!0,389:!0,427:!0,465:!0,512:!0,513:!0,514:!0,515:!0,526:!0,530:!0,531:!0,532:!0,540:!0,548:!0,554:!0,556:!0,563:!0,587:!0,601:!0,636:!0,989:!0,990:!0,993:!0,995:!0,1719:!0,1720:!0,1723:!0,2049:!0,3659:!0,4045:!0,5060:!0,5061:!0,6e3:!0,6566:!0,6665:!0,6666:!0,6667:!0,6668:!0,6669:!0,6697:!0,10080:!0};function _(D,b,S,P="127.0.0.1"){let p=!1,g,h=1;const f=I.createServer({pauseOnConnect:!0});function w(l,d){p||(p=!0,f.removeAllListeners(),f.close(),g&&clearTimeout(g),d(l))}return new Promise(l=>{g=setTimeout(()=>{w(0,l)},S),f.on("listening",()=>{w(D,l)}),f.on("error",d=>{d&&(d.code==="EADDRINUSE"||d.code==="EACCES")&&h<b?(D++,h++,f.listen(D,P)):w(0,l)}),f.on("close",()=>{w(0,l)}),f.listen(D,P)})}e.findFreePortFaster=_;function k(D){try{D.removeAllListeners("connect"),D.removeAllListeners("error"),D.end(),D.destroy(),D.unref()}catch(b){console.error(b)}}}),define(ce[134],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isUtilityProcess=void 0;function I(O){return!!O.parentPort}e.isUtilityProcess=I}),define(ce[135],le([10,9]),function(te,e){return te.create("sql/base/common/locConstants",e)}),define(ce[91],le([0,1,135]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.aboutDetail=e.getNewThemeNotification=e.getThemeUpdatedNotification=e.installTooltip=e.downloadTooltip=e.download=e.experimentalCustomizationDescription=e.outputFontFamilyDescription=e.outputFontSizeDescription=e.outputLineHeightDescription=e.interactiveWindowCollapseCodeCellsDescription=e.markupFontSizeDescription=e.textOutputLineLimitDescription=e.globalToolbarShowLabelDescription=e.consolidatedRunButtonDescription=e.dragAndDropDescription=e.showFoldingControlsDescription=e.consolidatedOutputButtonDescription=e.globalToolbarDescription=e.insertToolbarPositionDescription=e.focusIndicatorDescription=e.compactViewDescription=e.undoRedoPerCellDescription=e.cellToolbarVisibilityDescription=e.diffEnablePreviewDescription=e.showCellStatusbarDescription=e.cellToolbarLocationDescription=e.displayOrderDescription=e.terminalIntegratedInheritEnvDescription=e.terminalIntegratedEnvWindowsDescription=e.terminalIntegratedEnvLinuxDescription=e.terminalIntegratedEnvOsxDescription=e.terminalIntegratedDetectLocaleDescrption=e.terminalIntegratedCommandsToSkipShellDescrption=e.terminalIntegratedAutoRepliesDescription=e.terminalIntegratedAllowChordsDescription=e.windowTitleAppNameDescription=e.versionMismatchVsCode=e.versionMismatch=e.versionSyntax=e.notebooksNotSupportedError=e.workspaceTrustEmptyWindowDescription=e.workspaceTrustDescription=e.desktopContributionMiinstallVsix=e.watermarkNewNotebook=e.watermarkNewSqlFile=e.localizationsContributionActivateLanguagePack=e.localizationsContributionUpdateLocale=e.watcherExclude=e.filesContributionMaxMemoryForLargeFilesMB=e.fileActionsContributionMiNewDeployment=e.fileActionsContributionMiNewNotebook=e.fileActionsContributionMiNewQuery=e.fileActionsContributionNewQuery=e.extensionsWorkbenchServiceIncompatible=e.extensionsViewsScenarioTypeUndefined=e.extensionsViewletRecommendedExtensions=e.extensionsActionsReinstallActionSuccessReload=e.extensionsActionsInstallExtensionCompletedAndReloadRequired=e.extensionsActionsEnableRemote=e.extensionsActionsUninstallExtensionComplete=e.extensionsActionsPostDisableTooltip=e.extensionsActionsPostEnableTooltip=e.extensionsActionsEnableLocally=e.extensionsActionsPostUpdateTooltip=e.extensionsActionsPostUninstallTooltip=e.extensionsContributionInstallVSIXActionSuccessReload=e.extensionsContributionInstallVSIXActionAllowNone=e.extensionsContributionExtensionsPolicy=e.menusExtensionPointDataGridContext=e.menusExtensionPointConnectionDialogBrowseTreeContext=e.menusExtensionPointObjectExplorerContext=e.menusExtensionPointDataExplorerContext=e.menusExtensionPointDataExplorerAction=e.menusExtensionPointNotebookToolbar=e.menusExtensionPointNotebookTitle=e.menusExtensionPointNotebookCellTitle=e.menusExtensionPointDashboardToolbar=e.updateConfigContributionShowReleaseNotes=e.updateConfigContributionEnableWindowsBackgroundUpdates=e.updateConfigContributionDefault=e.issueReporterMainAzuredatastudio=void 0,e.issueReporterMainAzuredatastudio=(0,I.localize)(0,null),e.updateConfigContributionDefault=(0,I.localize)(1,null),e.updateConfigContributionEnableWindowsBackgroundUpdates=(0,I.localize)(2,null),e.updateConfigContributionShowReleaseNotes=(0,I.localize)(3,null),e.menusExtensionPointDashboardToolbar=(0,I.localize)(4,null),e.menusExtensionPointNotebookCellTitle=(0,I.localize)(5,null),e.menusExtensionPointNotebookTitle=(0,I.localize)(6,null),e.menusExtensionPointNotebookToolbar=(0,I.localize)(7,null),e.menusExtensionPointDataExplorerAction=(0,I.localize)(8,null),e.menusExtensionPointDataExplorerContext=(0,I.localize)(9,null),e.menusExtensionPointObjectExplorerContext=(0,I.localize)(10,null),e.menusExtensionPointConnectionDialogBrowseTreeContext=(0,I.localize)(11,null),e.menusExtensionPointDataGridContext=(0,I.localize)(12,null),e.extensionsContributionExtensionsPolicy=(0,I.localize)(13,null),e.extensionsContributionInstallVSIXActionAllowNone=(0,I.localize)(14,null);function O(m){return(0,I.localize)(15,null,m)}e.extensionsContributionInstallVSIXActionSuccessReload=O,e.extensionsActionsPostUninstallTooltip=(0,I.localize)(16,null),e.extensionsActionsPostUpdateTooltip=(0,I.localize)(17,null),e.extensionsActionsEnableLocally=(0,I.localize)(18,null),e.extensionsActionsPostEnableTooltip=(0,I.localize)(19,null),e.extensionsActionsPostDisableTooltip=(0,I.localize)(20,null);function A(m){return(0,I.localize)(21,null,m)}e.extensionsActionsUninstallExtensionComplete=A;function _(m){return(0,I.localize)(22,null,m)}e.extensionsActionsEnableRemote=_;function k(m){return(0,I.localize)(23,null,m)}e.extensionsActionsInstallExtensionCompletedAndReloadRequired=k;function D(m){return(0,I.localize)(24,null,m)}e.extensionsActionsReinstallActionSuccessReload=D,e.extensionsViewletRecommendedExtensions=(0,I.localize)(25,null),e.extensionsViewsScenarioTypeUndefined=(0,I.localize)(26,null);function b(m,y,T,t){return(0,I.localize)(27,null,y,m,T,t)}e.extensionsWorkbenchServiceIncompatible=b,e.fileActionsContributionNewQuery=(0,I.localize)(28,null),e.fileActionsContributionMiNewQuery=(0,I.localize)(29,null),e.fileActionsContributionMiNewNotebook=(0,I.localize)(30,null),e.fileActionsContributionMiNewDeployment=(0,I.localize)(31,null),e.filesContributionMaxMemoryForLargeFilesMB=(0,I.localize)(32,null),e.watcherExclude=(0,I.localize)(33,null);function S(m){return(0,I.localize)(34,null,m)}e.localizationsContributionUpdateLocale=S;function P(m){return(0,I.localize)(35,null,m)}e.localizationsContributionActivateLanguagePack=P,e.watermarkNewSqlFile=(0,I.localize)(36,null),e.watermarkNewNotebook=(0,I.localize)(37,null),e.desktopContributionMiinstallVsix=(0,I.localize)(38,null),e.workspaceTrustDescription=(0,I.localize)(39,null);function p(m){return(0,I.localize)(40,null,m)}e.workspaceTrustEmptyWindowDescription=p,e.notebooksNotSupportedError=(0,I.localize)(41,null);function g(m,y){return(0,I.localize)(42,null,m,y)}e.versionSyntax=g;function h(m,y){return(0,I.localize)(43,null,m,y)}e.versionMismatch=h;function f(m,y,T){return(0,I.localize)(44,null,m,y,T)}e.versionMismatchVsCode=f,e.windowTitleAppNameDescription=(0,I.localize)(45,null),e.terminalIntegratedAllowChordsDescription=(0,I.localize)(46,null),e.terminalIntegratedAutoRepliesDescription=(0,I.localize)(47,null,'`"Terminate batch job (Y/N)": "\\r"`','`"\\r"`');function w(m){return(0,I.localize)(48,null,m.sort().map(y=>`- ${y}`).join(`
`),`[${(0,I.localize)(49,null)}](command:workbench.action.openRawDefaultSettings '${(0,I.localize)(50,null)}')`)}e.terminalIntegratedCommandsToSkipShellDescrption=w,e.terminalIntegratedDetectLocaleDescrption=(0,I.localize)(51,null),e.terminalIntegratedEnvOsxDescription=(0,I.localize)(52,null),e.terminalIntegratedEnvLinuxDescription=(0,I.localize)(53,null),e.terminalIntegratedEnvWindowsDescription=(0,I.localize)(54,null),e.terminalIntegratedInheritEnvDescription=(0,I.localize)(55,null),e.displayOrderDescription=(0,I.localize)(56,null),e.cellToolbarLocationDescription=(0,I.localize)(57,null),e.showCellStatusbarDescription=(0,I.localize)(58,null),e.diffEnablePreviewDescription=(0,I.localize)(59,null),e.cellToolbarVisibilityDescription=(0,I.localize)(60,null),e.undoRedoPerCellDescription=(0,I.localize)(61,null),e.compactViewDescription=(0,I.localize)(62,null),e.focusIndicatorDescription=(0,I.localize)(63,null),e.insertToolbarPositionDescription=(0,I.localize)(64,null),e.globalToolbarDescription=(0,I.localize)(65,null),e.consolidatedOutputButtonDescription=(0,I.localize)(66,null),e.showFoldingControlsDescription=(0,I.localize)(67,null),e.dragAndDropDescription=(0,I.localize)(68,null),e.consolidatedRunButtonDescription=(0,I.localize)(69,null),e.globalToolbarShowLabelDescription=(0,I.localize)(70,null),e.textOutputLineLimitDescription=(0,I.localize)(71,null),e.markupFontSizeDescription=(0,I.localize)(72,null),e.interactiveWindowCollapseCodeCellsDescription=(0,I.localize)(73,null),e.outputLineHeightDescription=(0,I.localize)(74,null),e.outputFontSizeDescription=(0,I.localize)(75,null),e.outputFontFamilyDescription=(0,I.localize)(76,null),e.experimentalCustomizationDescription=(0,I.localize)(77,null),e.download=(0,I.localize)(78,null),e.downloadTooltip=(0,I.localize)(79,null),e.installTooltip=(0,I.localize)(80,null);function l(m){return(0,I.localize)(81,null,m)}e.getThemeUpdatedNotification=l;function d(m){return(0,I.localize)(82,null,m)}e.getNewThemeNotification=d;function c(m,y,T,t,o,n,s,i,r){return(0,I.localize)(83,null,m,y,T,r,t,o,n,s,i)}e.aboutDetail=c}),define(ce[136],le([10,9]),function(te,e){return te.create("vs/base/common/date",e)}),define(ce[61],le([0,1,136]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toLocalISOString=e.fromNow=void 0;const O=60,A=O*60,_=A*24,k=_*7,D=_*30,b=_*365;function S(p,g,h,f){typeof p!="number"&&(p=p.getTime());const w=Math.round((new Date().getTime()-p)/1e3);if(w<-30)return(0,I.localize)(0,null,S(new Date().getTime()+w*1e3,!1));if(!f&&w<30)return(0,I.localize)(1,null);let l;return w<O?(l=w,g?l===1?h?(0,I.localize)(2,null,l):(0,I.localize)(3,null,l):h?(0,I.localize)(4,null,l):(0,I.localize)(5,null,l):l===1?h?(0,I.localize)(6,null,l):(0,I.localize)(7,null,l):h?(0,I.localize)(8,null,l):(0,I.localize)(9,null,l)):w<A?(l=Math.floor(w/O),g?l===1?h?(0,I.localize)(10,null,l):(0,I.localize)(11,null,l):h?(0,I.localize)(12,null,l):(0,I.localize)(13,null,l):l===1?h?(0,I.localize)(14,null,l):(0,I.localize)(15,null,l):h?(0,I.localize)(16,null,l):(0,I.localize)(17,null,l)):w<_?(l=Math.floor(w/A),g?l===1?h?(0,I.localize)(18,null,l):(0,I.localize)(19,null,l):h?(0,I.localize)(20,null,l):(0,I.localize)(21,null,l):l===1?h?(0,I.localize)(22,null,l):(0,I.localize)(23,null,l):h?(0,I.localize)(24,null,l):(0,I.localize)(25,null,l)):w<k?(l=Math.floor(w/_),g?l===1?(0,I.localize)(26,null,l):(0,I.localize)(27,null,l):l===1?(0,I.localize)(28,null,l):(0,I.localize)(29,null,l)):w<D?(l=Math.floor(w/k),g?l===1?h?(0,I.localize)(30,null,l):(0,I.localize)(31,null,l):h?(0,I.localize)(32,null,l):(0,I.localize)(33,null,l):l===1?h?(0,I.localize)(34,null,l):(0,I.localize)(35,null,l):h?(0,I.localize)(36,null,l):(0,I.localize)(37,null,l)):w<b?(l=Math.floor(w/D),g?l===1?h?(0,I.localize)(38,null,l):(0,I.localize)(39,null,l):h?(0,I.localize)(40,null,l):(0,I.localize)(41,null,l):l===1?h?(0,I.localize)(42,null,l):(0,I.localize)(43,null,l):h?(0,I.localize)(44,null,l):(0,I.localize)(45,null,l)):(l=Math.floor(w/b),g?l===1?h?(0,I.localize)(46,null,l):(0,I.localize)(47,null,l):h?(0,I.localize)(48,null,l):(0,I.localize)(49,null,l):l===1?h?(0,I.localize)(50,null,l):(0,I.localize)(51,null,l):h?(0,I.localize)(52,null,l):(0,I.localize)(53,null,l))}e.fromNow=S;function P(p){return p.getFullYear()+"-"+String(p.getMonth()+1).padStart(2,"0")+"-"+String(p.getDate()).padStart(2,"0")+"T"+String(p.getHours()).padStart(2,"0")+":"+String(p.getMinutes()).padStart(2,"0")+":"+String(p.getSeconds()).padStart(2,"0")+"."+(p.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}e.toLocalISOString=P}),define(ce[137],le([10,9]),function(te,e){return te.create("vs/base/common/errorMessage",e)}),define(ce[38],le([0,1,20,12,137]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createErrorWithActions=e.isErrorWithActions=e.toErrorMessage=void 0;function _(p,g){return g&&(p.stack||p.stacktrace)?A.localize(0,null,D(p),k(p.stack)||k(p.stacktrace)):D(p)}function k(p){return Array.isArray(p)?p.join(`
`):p}function D(p){return p.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${p.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof p.code=="string"&&typeof p.errno=="number"&&typeof p.syscall=="string"?A.localize(1,null,p.message):p.message||A.localize(2,null)}function b(p=null,g=!1){if(!p)return A.localize(3,null);if(Array.isArray(p)){const h=I.coalesce(p),f=b(h[0],g);return h.length>1?A.localize(4,null,f,h.length):f}if(O.isString(p))return p;if(p.detail){const h=p.detail;if(h.error)return _(h.error,g);if(h.exception)return _(h.exception,g)}return p.stack?_(p,g):p.message?p.message:A.localize(5,null)}e.toErrorMessage=b;function S(p){const g=p;return g instanceof Error&&Array.isArray(g.actions)}e.isErrorWithActions=S;function P(p,g){let h;return typeof p=="string"?h=new Error(p):h=p,h.actions=g,h}e.createErrorWithActions=P}),define(ce[138],le([10,9]),function(te,e){return te.create("vs/base/common/jsonErrorMessages",e)}),define(ce[139],le([0,1,138]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getParseErrorMessage=void 0;function O(A){switch(A){case 1:return(0,I.localize)(0,null);case 2:return(0,I.localize)(1,null);case 3:return(0,I.localize)(2,null);case 4:return(0,I.localize)(3,null);case 5:return(0,I.localize)(4,null);case 6:return(0,I.localize)(5,null);case 7:return(0,I.localize)(6,null);case 8:return(0,I.localize)(7,null);case 9:return(0,I.localize)(8,null);default:return""}}e.getParseErrorMessage=O}),define(ce[140],le([10,9]),function(te,e){return te.create("vs/base/common/platform",e)}),define(ce[6],le([0,1,140]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAndroid=e.isEdge=e.isSafari=e.isFirefox=e.isChrome=e.isLittleEndian=e.OS=e.OperatingSystem=e.setTimeout0=e.setTimeout0IsFaster=e.translationsConfigFile=e.platformLocale=e.locale=e.Language=e.language=e.userAgent=e.platform=e.isCI=e.isMobile=e.isIOS=e.isWebWorker=e.isWeb=e.isElectron=e.isNative=e.isLinuxSnap=e.isLinux=e.isMacintosh=e.isWindows=e.PlatformToString=e.Platform=e.globals=e.LANGUAGE_DEFAULT=void 0,e.LANGUAGE_DEFAULT="en";let O=!1,A=!1,_=!1,k=!1,D=!1,b=!1,S=!1,P=!1,p=!1,g=!1,h,f=e.LANGUAGE_DEFAULT,w=e.LANGUAGE_DEFAULT,l,d;e.globals=typeof self=="object"?self:typeof global=="object"?global:{};let c;typeof e.globals.vscode<"u"&&typeof e.globals.vscode.process<"u"?c=e.globals.vscode.process:typeof process<"u"&&(c=process);const m=typeof c?.versions?.electron=="string",y=m&&c?.type==="renderer";if(typeof navigator=="object"&&!y)d=navigator.userAgent,O=d.indexOf("Windows")>=0,A=d.indexOf("Macintosh")>=0,P=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_=d.indexOf("Linux")>=0,g=d?.indexOf("Mobi")>=0,b=!0,h=I.getConfiguredDefaultLocale(I.localize(0,null))||e.LANGUAGE_DEFAULT,f=h,w=navigator.language;else if(typeof c=="object"){O=c.platform==="win32",A=c.platform==="darwin",_=c.platform==="linux",k=_&&!!c.env.SNAP&&!!c.env.SNAP_REVISION,S=m,p=!!c.env.CI||!!c.env.BUILD_ARTIFACTSTAGINGDIRECTORY,h=e.LANGUAGE_DEFAULT,f=e.LANGUAGE_DEFAULT;const E=c.env.VSCODE_NLS_CONFIG;if(E)try{const v=JSON.parse(E),u=v.availableLanguages["*"];h=v.locale,w=v.osLocale,f=u||e.LANGUAGE_DEFAULT,l=v._translationsConfigFile}catch{}D=!0}else console.error("Unable to resolve platform.");var T;(function(E){E[E.Web=0]="Web",E[E.Mac=1]="Mac",E[E.Linux=2]="Linux",E[E.Windows=3]="Windows"})(T||(e.Platform=T={}));function t(E){switch(E){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}e.PlatformToString=t;let o=0;A?o=1:O?o=3:_&&(o=2),e.isWindows=O,e.isMacintosh=A,e.isLinux=_,e.isLinuxSnap=k,e.isNative=D,e.isElectron=S,e.isWeb=b,e.isWebWorker=b&&typeof e.globals.importScripts=="function",e.isIOS=P,e.isMobile=g,e.isCI=p,e.platform=o,e.userAgent=d,e.language=f;var n;(function(E){function v(){return e.language}E.value=v;function u(){return e.language.length===2?e.language==="en":e.language.length>=3?e.language[0]==="e"&&e.language[1]==="n"&&e.language[2]==="-":!1}E.isDefaultVariant=u;function C(){return e.language==="en"}E.isDefault=C})(n||(e.Language=n={})),e.locale=h,e.platformLocale=w,e.translationsConfigFile=l,e.setTimeout0IsFaster=typeof e.globals.postMessage=="function"&&!e.globals.importScripts,e.setTimeout0=(()=>{if(e.setTimeout0IsFaster){const E=[];e.globals.addEventListener("message",u=>{if(u.data&&u.data.vscodeScheduleAsyncWork)for(let C=0,U=E.length;C<U;C++){const F=E[C];if(F.id===u.data.vscodeScheduleAsyncWork){E.splice(C,1),F.callback();return}}});let v=0;return u=>{const C=++v;E.push({id:C,callback:u}),e.globals.postMessage({vscodeScheduleAsyncWork:C},"*")}}return E=>setTimeout(E)})();var s;(function(E){E[E.Windows=1]="Windows",E[E.Macintosh=2]="Macintosh",E[E.Linux=3]="Linux"})(s||(e.OperatingSystem=s={})),e.OS=A||P?2:O?1:3;let i=!0,r=!1;function a(){if(!r){r=!0;const E=new Uint8Array(2);E[0]=1,E[1]=2,i=new Uint16Array(E.buffer)[0]===(2<<8)+1}return i}e.isLittleEndian=a,e.isChrome=!!(e.userAgent&&e.userAgent.indexOf("Chrome")>=0),e.isFirefox=!!(e.userAgent&&e.userAgent.indexOf("Firefox")>=0),e.isSafari=!!(!e.isChrome&&e.userAgent&&e.userAgent.indexOf("Safari")>=0),e.isEdge=!!(e.userAgent&&e.userAgent.indexOf("Edg/")>=0),e.isAndroid=!!(e.userAgent&&e.userAgent.indexOf("Android")>=0)}),define(ce[37],le([0,1,6]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arch=e.platform=e.env=e.cwd=void 0;let O;if(typeof I.globals.vscode<"u"&&typeof I.globals.vscode.process<"u"){const A=I.globals.vscode.process;O={get platform(){return A.platform},get arch(){return A.arch},get env(){return A.env},cwd(){return A.cwd()}}}else typeof process<"u"?O={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:O={get platform(){return I.isWindows?"win32":I.isMacintosh?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};e.cwd=O.cwd,e.env=O.env,e.platform=O.platform,e.arch=O.arch}),define(ce[16],le([0,1,37]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.delimiter=e.sep=e.toNamespacedPath=e.parse=e.format=e.extname=e.basename=e.dirname=e.relative=e.resolve=e.join=e.isAbsolute=e.normalize=e.posix=e.win32=void 0;const O=65,A=97,_=90,k=122,D=46,b=47,S=92,P=58,p=63;class g extends Error{constructor(o,n,s){let i;typeof n=="string"&&n.indexOf("not ")===0?(i="must not be",n=n.replace(/^not /,"")):i="must be";const r=o.indexOf(".")!==-1?"property":"argument";let a=`The "${o}" ${r} ${i} of type ${n}`;a+=`. Received type ${typeof s}`,super(a),this.code="ERR_INVALID_ARG_TYPE"}}function h(t,o){if(t===null||typeof t!="object")throw new g(o,"Object",t)}function f(t,o){if(typeof t!="string")throw new g(o,"string",t)}const w=I.platform==="win32";function l(t){return t===b||t===S}function d(t){return t===b}function c(t){return t>=O&&t<=_||t>=A&&t<=k}function m(t,o,n,s){let i="",r=0,a=-1,E=0,v=0;for(let u=0;u<=t.length;++u){if(u<t.length)v=t.charCodeAt(u);else{if(s(v))break;v=b}if(s(v)){if(!(a===u-1||E===1))if(E===2){if(i.length<2||r!==2||i.charCodeAt(i.length-1)!==D||i.charCodeAt(i.length-2)!==D){if(i.length>2){const C=i.lastIndexOf(n);C===-1?(i="",r=0):(i=i.slice(0,C),r=i.length-1-i.lastIndexOf(n)),a=u,E=0;continue}else if(i.length!==0){i="",r=0,a=u,E=0;continue}}o&&(i+=i.length>0?`${n}..`:"..",r=2)}else i.length>0?i+=`${n}${t.slice(a+1,u)}`:i=t.slice(a+1,u),r=u-a-1;a=u,E=0}else v===D&&E!==-1?++E:E=-1}return i}function y(t,o){h(o,"pathObject");const n=o.dir||o.root,s=o.base||`${o.name||""}${o.ext||""}`;return n?n===o.root?`${n}${s}`:`${n}${t}${s}`:s}e.win32={resolve(...t){let o="",n="",s=!1;for(let i=t.length-1;i>=-1;i--){let r;if(i>=0){if(r=t[i],f(r,"path"),r.length===0)continue}else o.length===0?r=I.cwd():(r=I.env[`=${o}`]||I.cwd(),(r===void 0||r.slice(0,2).toLowerCase()!==o.toLowerCase()&&r.charCodeAt(2)===S)&&(r=`${o}\\`));const a=r.length;let E=0,v="",u=!1;const C=r.charCodeAt(0);if(a===1)l(C)&&(E=1,u=!0);else if(l(C))if(u=!0,l(r.charCodeAt(1))){let U=2,F=U;for(;U<a&&!l(r.charCodeAt(U));)U++;if(U<a&&U!==F){const M=r.slice(F,U);for(F=U;U<a&&l(r.charCodeAt(U));)U++;if(U<a&&U!==F){for(F=U;U<a&&!l(r.charCodeAt(U));)U++;(U===a||U!==F)&&(v=`\\\\${M}\\${r.slice(F,U)}`,E=U)}}}else E=1;else c(C)&&r.charCodeAt(1)===P&&(v=r.slice(0,2),E=2,a>2&&l(r.charCodeAt(2))&&(u=!0,E=3));if(v.length>0)if(o.length>0){if(v.toLowerCase()!==o.toLowerCase())continue}else o=v;if(s){if(o.length>0)break}else if(n=`${r.slice(E)}\\${n}`,s=u,u&&o.length>0)break}return n=m(n,!s,"\\",l),s?`${o}\\${n}`:`${o}${n}`||"."},normalize(t){f(t,"path");const o=t.length;if(o===0)return".";let n=0,s,i=!1;const r=t.charCodeAt(0);if(o===1)return d(r)?"\\":t;if(l(r))if(i=!0,l(t.charCodeAt(1))){let E=2,v=E;for(;E<o&&!l(t.charCodeAt(E));)E++;if(E<o&&E!==v){const u=t.slice(v,E);for(v=E;E<o&&l(t.charCodeAt(E));)E++;if(E<o&&E!==v){for(v=E;E<o&&!l(t.charCodeAt(E));)E++;if(E===o)return`\\\\${u}\\${t.slice(v)}\\`;E!==v&&(s=`\\\\${u}\\${t.slice(v,E)}`,n=E)}}}else n=1;else c(r)&&t.charCodeAt(1)===P&&(s=t.slice(0,2),n=2,o>2&&l(t.charCodeAt(2))&&(i=!0,n=3));let a=n<o?m(t.slice(n),!i,"\\",l):"";return a.length===0&&!i&&(a="."),a.length>0&&l(t.charCodeAt(o-1))&&(a+="\\"),s===void 0?i?`\\${a}`:a:i?`${s}\\${a}`:`${s}${a}`},isAbsolute(t){f(t,"path");const o=t.length;if(o===0)return!1;const n=t.charCodeAt(0);return l(n)||o>2&&c(n)&&t.charCodeAt(1)===P&&l(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let o,n;for(let r=0;r<t.length;++r){const a=t[r];f(a,"path"),a.length>0&&(o===void 0?o=n=a:o+=`\\${a}`)}if(o===void 0)return".";let s=!0,i=0;if(typeof n=="string"&&l(n.charCodeAt(0))){++i;const r=n.length;r>1&&l(n.charCodeAt(1))&&(++i,r>2&&(l(n.charCodeAt(2))?++i:s=!1))}if(s){for(;i<o.length&&l(o.charCodeAt(i));)i++;i>=2&&(o=`\\${o.slice(i)}`)}return e.win32.normalize(o)},relative(t,o){if(f(t,"from"),f(o,"to"),t===o)return"";const n=e.win32.resolve(t),s=e.win32.resolve(o);if(n===s||(t=n.toLowerCase(),o=s.toLowerCase(),t===o))return"";let i=0;for(;i<t.length&&t.charCodeAt(i)===S;)i++;let r=t.length;for(;r-1>i&&t.charCodeAt(r-1)===S;)r--;const a=r-i;let E=0;for(;E<o.length&&o.charCodeAt(E)===S;)E++;let v=o.length;for(;v-1>E&&o.charCodeAt(v-1)===S;)v--;const u=v-E,C=a<u?a:u;let U=-1,F=0;for(;F<C;F++){const z=t.charCodeAt(i+F);if(z!==o.charCodeAt(E+F))break;z===S&&(U=F)}if(F!==C){if(U===-1)return s}else{if(u>C){if(o.charCodeAt(E+F)===S)return s.slice(E+F+1);if(F===2)return s.slice(E+F)}a>C&&(t.charCodeAt(i+F)===S?U=F:F===2&&(U=3)),U===-1&&(U=0)}let M="";for(F=i+U+1;F<=r;++F)(F===r||t.charCodeAt(F)===S)&&(M+=M.length===0?"..":"\\..");return E+=U,M.length>0?`${M}${s.slice(E,v)}`:(s.charCodeAt(E)===S&&++E,s.slice(E,v))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;const o=e.win32.resolve(t);if(o.length<=2)return t;if(o.charCodeAt(0)===S){if(o.charCodeAt(1)===S){const n=o.charCodeAt(2);if(n!==p&&n!==D)return`\\\\?\\UNC\\${o.slice(2)}`}}else if(c(o.charCodeAt(0))&&o.charCodeAt(1)===P&&o.charCodeAt(2)===S)return`\\\\?\\${o}`;return t},dirname(t){f(t,"path");const o=t.length;if(o===0)return".";let n=-1,s=0;const i=t.charCodeAt(0);if(o===1)return l(i)?t:".";if(l(i)){if(n=s=1,l(t.charCodeAt(1))){let E=2,v=E;for(;E<o&&!l(t.charCodeAt(E));)E++;if(E<o&&E!==v){for(v=E;E<o&&l(t.charCodeAt(E));)E++;if(E<o&&E!==v){for(v=E;E<o&&!l(t.charCodeAt(E));)E++;if(E===o)return t;E!==v&&(n=s=E+1)}}}}else c(i)&&t.charCodeAt(1)===P&&(n=o>2&&l(t.charCodeAt(2))?3:2,s=n);let r=-1,a=!0;for(let E=o-1;E>=s;--E)if(l(t.charCodeAt(E))){if(!a){r=E;break}}else a=!1;if(r===-1){if(n===-1)return".";r=n}return t.slice(0,r)},basename(t,o){o!==void 0&&f(o,"ext"),f(t,"path");let n=0,s=-1,i=!0,r;if(t.length>=2&&c(t.charCodeAt(0))&&t.charCodeAt(1)===P&&(n=2),o!==void 0&&o.length>0&&o.length<=t.length){if(o===t)return"";let a=o.length-1,E=-1;for(r=t.length-1;r>=n;--r){const v=t.charCodeAt(r);if(l(v)){if(!i){n=r+1;break}}else E===-1&&(i=!1,E=r+1),a>=0&&(v===o.charCodeAt(a)?--a===-1&&(s=r):(a=-1,s=E))}return n===s?s=E:s===-1&&(s=t.length),t.slice(n,s)}for(r=t.length-1;r>=n;--r)if(l(t.charCodeAt(r))){if(!i){n=r+1;break}}else s===-1&&(i=!1,s=r+1);return s===-1?"":t.slice(n,s)},extname(t){f(t,"path");let o=0,n=-1,s=0,i=-1,r=!0,a=0;t.length>=2&&t.charCodeAt(1)===P&&c(t.charCodeAt(0))&&(o=s=2);for(let E=t.length-1;E>=o;--E){const v=t.charCodeAt(E);if(l(v)){if(!r){s=E+1;break}continue}i===-1&&(r=!1,i=E+1),v===D?n===-1?n=E:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||i===-1||a===0||a===1&&n===i-1&&n===s+1?"":t.slice(n,i)},format:y.bind(null,"\\"),parse(t){f(t,"path");const o={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return o;const n=t.length;let s=0,i=t.charCodeAt(0);if(n===1)return l(i)?(o.root=o.dir=t,o):(o.base=o.name=t,o);if(l(i)){if(s=1,l(t.charCodeAt(1))){let U=2,F=U;for(;U<n&&!l(t.charCodeAt(U));)U++;if(U<n&&U!==F){for(F=U;U<n&&l(t.charCodeAt(U));)U++;if(U<n&&U!==F){for(F=U;U<n&&!l(t.charCodeAt(U));)U++;U===n?s=U:U!==F&&(s=U+1)}}}}else if(c(i)&&t.charCodeAt(1)===P){if(n<=2)return o.root=o.dir=t,o;if(s=2,l(t.charCodeAt(2))){if(n===3)return o.root=o.dir=t,o;s=3}}s>0&&(o.root=t.slice(0,s));let r=-1,a=s,E=-1,v=!0,u=t.length-1,C=0;for(;u>=s;--u){if(i=t.charCodeAt(u),l(i)){if(!v){a=u+1;break}continue}E===-1&&(v=!1,E=u+1),i===D?r===-1?r=u:C!==1&&(C=1):r!==-1&&(C=-1)}return E!==-1&&(r===-1||C===0||C===1&&r===E-1&&r===a+1?o.base=o.name=t.slice(a,E):(o.name=t.slice(a,r),o.base=t.slice(a,E),o.ext=t.slice(r,E))),a>0&&a!==s?o.dir=t.slice(0,a-1):o.dir=o.root,o},sep:"\\",delimiter:";",win32:null,posix:null};const T=(()=>{if(w){const t=/\\/g;return()=>{const o=I.cwd().replace(t,"/");return o.slice(o.indexOf("/"))}}return()=>I.cwd()})();e.posix={resolve(...t){let o="",n=!1;for(let s=t.length-1;s>=-1&&!n;s--){const i=s>=0?t[s]:T();f(i,"path"),i.length!==0&&(o=`${i}/${o}`,n=i.charCodeAt(0)===b)}return o=m(o,!n,"/",d),n?`/${o}`:o.length>0?o:"."},normalize(t){if(f(t,"path"),t.length===0)return".";const o=t.charCodeAt(0)===b,n=t.charCodeAt(t.length-1)===b;return t=m(t,!o,"/",d),t.length===0?o?"/":n?"./":".":(n&&(t+="/"),o?`/${t}`:t)},isAbsolute(t){return f(t,"path"),t.length>0&&t.charCodeAt(0)===b},join(...t){if(t.length===0)return".";let o;for(let n=0;n<t.length;++n){const s=t[n];f(s,"path"),s.length>0&&(o===void 0?o=s:o+=`/${s}`)}return o===void 0?".":e.posix.normalize(o)},relative(t,o){if(f(t,"from"),f(o,"to"),t===o||(t=e.posix.resolve(t),o=e.posix.resolve(o),t===o))return"";const n=1,s=t.length,i=s-n,r=1,a=o.length-r,E=i<a?i:a;let v=-1,u=0;for(;u<E;u++){const U=t.charCodeAt(n+u);if(U!==o.charCodeAt(r+u))break;U===b&&(v=u)}if(u===E)if(a>E){if(o.charCodeAt(r+u)===b)return o.slice(r+u+1);if(u===0)return o.slice(r+u)}else i>E&&(t.charCodeAt(n+u)===b?v=u:u===0&&(v=0));let C="";for(u=n+v+1;u<=s;++u)(u===s||t.charCodeAt(u)===b)&&(C+=C.length===0?"..":"/..");return`${C}${o.slice(r+v)}`},toNamespacedPath(t){return t},dirname(t){if(f(t,"path"),t.length===0)return".";const o=t.charCodeAt(0)===b;let n=-1,s=!0;for(let i=t.length-1;i>=1;--i)if(t.charCodeAt(i)===b){if(!s){n=i;break}}else s=!1;return n===-1?o?"/":".":o&&n===1?"//":t.slice(0,n)},basename(t,o){o!==void 0&&f(o,"ext"),f(t,"path");let n=0,s=-1,i=!0,r;if(o!==void 0&&o.length>0&&o.length<=t.length){if(o===t)return"";let a=o.length-1,E=-1;for(r=t.length-1;r>=0;--r){const v=t.charCodeAt(r);if(v===b){if(!i){n=r+1;break}}else E===-1&&(i=!1,E=r+1),a>=0&&(v===o.charCodeAt(a)?--a===-1&&(s=r):(a=-1,s=E))}return n===s?s=E:s===-1&&(s=t.length),t.slice(n,s)}for(r=t.length-1;r>=0;--r)if(t.charCodeAt(r)===b){if(!i){n=r+1;break}}else s===-1&&(i=!1,s=r+1);return s===-1?"":t.slice(n,s)},extname(t){f(t,"path");let o=-1,n=0,s=-1,i=!0,r=0;for(let a=t.length-1;a>=0;--a){const E=t.charCodeAt(a);if(E===b){if(!i){n=a+1;break}continue}s===-1&&(i=!1,s=a+1),E===D?o===-1?o=a:r!==1&&(r=1):o!==-1&&(r=-1)}return o===-1||s===-1||r===0||r===1&&o===s-1&&o===n+1?"":t.slice(o,s)},format:y.bind(null,"/"),parse(t){f(t,"path");const o={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return o;const n=t.charCodeAt(0)===b;let s;n?(o.root="/",s=1):s=0;let i=-1,r=0,a=-1,E=!0,v=t.length-1,u=0;for(;v>=s;--v){const C=t.charCodeAt(v);if(C===b){if(!E){r=v+1;break}continue}a===-1&&(E=!1,a=v+1),C===D?i===-1?i=v:u!==1&&(u=1):i!==-1&&(u=-1)}if(a!==-1){const C=r===0&&n?1:r;i===-1||u===0||u===1&&i===a-1&&i===r+1?o.base=o.name=t.slice(C,a):(o.name=t.slice(C,i),o.base=t.slice(C,a),o.ext=t.slice(i,a))}return r>0?o.dir=t.slice(0,r-1):n&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null},e.posix.win32=e.win32.win32=e.win32,e.posix.posix=e.win32.posix=e.posix,e.normalize=w?e.win32.normalize:e.posix.normalize,e.isAbsolute=w?e.win32.isAbsolute:e.posix.isAbsolute,e.join=w?e.win32.join:e.posix.join,e.resolve=w?e.win32.resolve:e.posix.resolve,e.relative=w?e.win32.relative:e.posix.relative,e.dirname=w?e.win32.dirname:e.posix.dirname,e.basename=w?e.win32.basename:e.posix.basename,e.extname=w?e.win32.extname:e.posix.extname,e.format=w?e.win32.format:e.posix.format,e.parse=w?e.win32.parse:e.posix.parse,e.toNamespacedPath=w?e.win32.toNamespacedPath:e.posix.toNamespacedPath,e.sep=w?e.win32.sep:e.posix.sep,e.delimiter=w?e.win32.delimiter:e.posix.delimiter}),define(ce[48],le([0,1,16,6,28,12]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomPath=e.parseLineAndColumnAware=e.indexOfPath=e.getDriveLetter=e.hasDriveLetter=e.isRootOrDriveLetter=e.sanitizeFilePath=e.isWindowsDriveLetter=e.isEqualOrParent=e.isEqual=e.isValidBasename=e.isUNC=e.getRoot=e.toPosixPath=e.toSlashes=e.isPathSeparator=void 0;function k(r){return r===47||r===92}e.isPathSeparator=k;function D(r){return r.replace(/[\\/]/g,I.posix.sep)}e.toSlashes=D;function b(r){return r.indexOf("/")===-1&&(r=D(r)),/^[a-zA-Z]:(\/|$)/.test(r)&&(r="/"+r),r}e.toPosixPath=b;function S(r,a=I.posix.sep){if(!r)return"";const E=r.length,v=r.charCodeAt(0);if(k(v)){if(k(r.charCodeAt(1))&&!k(r.charCodeAt(2))){let C=3;const U=C;for(;C<E&&!k(r.charCodeAt(C));C++);if(U!==C&&!k(r.charCodeAt(C+1))){for(C+=1;C<E;C++)if(k(r.charCodeAt(C)))return r.slice(0,C+1).replace(/[\\/]/g,a)}}return a}else if(d(v)&&r.charCodeAt(1)===58)return k(r.charCodeAt(2))?r.slice(0,2)+a:r.slice(0,2);let u=r.indexOf("://");if(u!==-1){for(u+=3;u<E;u++)if(k(r.charCodeAt(u)))return r.slice(0,u+1)}return""}e.getRoot=S;function P(r){if(!O.isWindows||!r||r.length<5)return!1;let a=r.charCodeAt(0);if(a!==92||(a=r.charCodeAt(1),a!==92))return!1;let E=2;const v=E;for(;E<r.length&&(a=r.charCodeAt(E),a!==92);E++);return!(v===E||(a=r.charCodeAt(E+1),isNaN(a)||a===92))}e.isUNC=P;const p=/[\\/:\*\?"<>\|]/g,g=/[\\/]/g,h=/^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])(\.(.*?))?$/i;function f(r,a=O.isWindows){const E=a?p:g;return!(!r||r.length===0||/^\s+$/.test(r)||(E.lastIndex=0,E.test(r))||a&&h.test(r)||r==="."||r===".."||a&&r[r.length-1]==="."||a&&r.length!==r.trim().length||r.length>255)}e.isValidBasename=f;function w(r,a,E){const v=r===a;return!E||v?v:!r||!a?!1:(0,A.equalsIgnoreCase)(r,a)}e.isEqual=w;function l(r,a,E,v=I.sep){if(r===a)return!0;if(!r||!a||a.length>r.length)return!1;if(E){if(!(0,A.startsWithIgnoreCase)(r,a))return!1;if(a.length===r.length)return!0;let C=a.length;return a.charAt(a.length-1)===v&&C--,r.charAt(C)===v}return a.charAt(a.length-1)!==v&&(a+=v),r.indexOf(a)===0}e.isEqualOrParent=l;function d(r){return r>=65&&r<=90||r>=97&&r<=122}e.isWindowsDriveLetter=d;function c(r,a){return O.isWindows&&r.endsWith(":")&&(r+=I.sep),(0,I.isAbsolute)(r)||(r=(0,I.join)(a,r)),r=(0,I.normalize)(r),O.isWindows?(r=(0,A.rtrim)(r,I.sep),r.endsWith(":")&&(r+=I.sep)):(r=(0,A.rtrim)(r,I.sep),r||(r=I.sep)),r}e.sanitizeFilePath=c;function m(r){const a=(0,I.normalize)(r);return O.isWindows?r.length>3?!1:y(a)&&(r.length===2||a.charCodeAt(2)===92):a===I.posix.sep}e.isRootOrDriveLetter=m;function y(r,a=O.isWindows){return a?d(r.charCodeAt(0))&&r.charCodeAt(1)===58:!1}e.hasDriveLetter=y;function T(r,a=O.isWindows){return y(r,a)?r[0]:void 0}e.getDriveLetter=T;function t(r,a,E){return a.length>r.length?-1:r===a?0:(E&&(r=r.toLowerCase(),a=a.toLowerCase()),r.indexOf(a))}e.indexOfPath=t;function o(r){const a=r.split(":");let E,v,u;for(const C of a){const U=Number(C);(0,_.isNumber)(U)?v===void 0?v=U:u===void 0&&(u=U):E=E?[E,C].join(":"):C}if(!E)throw new Error("Format for `--goto` should be: `FILE:LINE(:COLUMN)`");return{path:E,line:v!==void 0?v:void 0,column:u!==void 0?u:v!==void 0?1:void 0}}e.parseLineAndColumnAware=o;const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function i(r,a,E=8){let v="";for(let C=0;C<E;C++){let U;C===0&&O.isWindows&&!a&&(E===3||E===4)?U=s:U=n,v+=U.charAt(Math.floor(Math.random()*U.length))}let u;return a?u=`${a}-${v}`:u=v,r?(0,I.join)(r,u):u}e.randomPath=i}),define(ce[141],le([0,1,16]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeMimeType=e.getExtensionForMimeType=e.getMediaMime=e.getMediaOrTextMime=e.Mimes=void 0,e.Mimes=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"});const O={".css":"text/css",".csv":"text/csv",".htm":"text/html",".html":"text/html",".ics":"text/calendar",".js":"text/javascript",".mjs":"text/javascript",".txt":"text/plain",".xml":"text/xml"},A={".aac":"audio/x-aac",".avi":"video/x-msvideo",".bmp":"image/bmp",".flv":"video/x-flv",".gif":"image/gif",".ico":"image/x-icon",".jpe":"image/jpg",".jpeg":"image/jpg",".jpg":"image/jpg",".m1v":"video/mpeg",".m2a":"audio/mpeg",".m2v":"video/mpeg",".m3a":"audio/mpeg",".mid":"audio/midi",".midi":"audio/midi",".mk3d":"video/x-matroska",".mks":"video/x-matroska",".mkv":"video/x-matroska",".mov":"video/quicktime",".movie":"video/x-sgi-movie",".mp2":"audio/mpeg",".mp2a":"audio/mpeg",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4a":"audio/mp4",".mp4v":"video/mp4",".mpe":"video/mpeg",".mpeg":"video/mpeg",".mpg":"video/mpeg",".mpg4":"video/mp4",".mpga":"audio/mpeg",".oga":"audio/ogg",".ogg":"audio/ogg",".opus":"audio/opus",".ogv":"video/ogg",".png":"image/png",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".spx":"audio/ogg",".svg":"image/svg+xml",".tga":"image/x-tga",".tif":"image/tiff",".tiff":"image/tiff",".wav":"audio/x-wav",".webm":"video/webm",".webp":"image/webp",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".woff":"application/font-woff"};function _(P){const p=(0,I.extname)(P),g=O[p.toLowerCase()];return g!==void 0?g:k(P)}e.getMediaOrTextMime=_;function k(P){const p=(0,I.extname)(P);return A[p.toLowerCase()]}e.getMediaMime=k;function D(P){for(const p in A)if(A[p]===P)return p}e.getExtensionForMimeType=D;const b=/^(.+)\/(.+?)(;.+)?$/;function S(P,p){const g=b.exec(P);return g?`${g[1].toLowerCase()}/${g[2].toLowerCase()}${g[3]??""}`:p?void 0:P}e.normalizeMimeType=S}),define(ce[92],le([0,1,6]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeDangerousEnvVariables=e.sanitizeProcessEnvironment=e.TerminateResponseCode=e.Source=void 0;var O;(function(D){D[D.stdout=0]="stdout",D[D.stderr=1]="stderr"})(O||(e.Source=O={}));var A;(function(D){D[D.Success=0]="Success",D[D.Unknown=1]="Unknown",D[D.AccessDenied=2]="AccessDenied",D[D.ProcessNotFound=3]="ProcessNotFound"})(A||(e.TerminateResponseCode=A={}));function _(D,...b){const S=b.reduce((g,h)=>(g[h]=!0,g),{}),P=[/^ELECTRON_.+$/,/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,/^SNAP(|_.*)$/,/^GDK_PIXBUF_.+$/];Object.keys(D).filter(g=>!S[g]).forEach(g=>{for(let h=0;h<P.length;h++)if(g.search(P[h])!==-1){delete D[g];break}})}e.sanitizeProcessEnvironment=_;function k(D){D&&(delete D.DEBUG,I.isMacintosh&&delete D.DYLD_LIBRARY_PATH,I.isLinux&&delete D.LD_PRELOAD)}e.removeDangerousEnvVariables=k}),define(ce[11],le([0,1,16,6]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uriToFsPath=e.isUriComponents=e.URI=void 0;const A=/^\w[\w\d+.-]*$/,_=/^\//,k=/^\/\//;function D(s,i){if(!s.scheme&&i)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${s.authority}", path: "${s.path}", query: "${s.query}", fragment: "${s.fragment}"}`);if(s.scheme&&!A.test(s.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(s.path){if(s.authority){if(!_.test(s.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(k.test(s.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function b(s,i){return!s&&!i?"file":s}function S(s,i){switch(s){case"https":case"http":case"file":i?i[0]!==p&&(i=p+i):i=p;break}return i}const P="",p="/",g=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{static isUri(i){return i instanceof h?!0:i?typeof i.authority=="string"&&typeof i.fragment=="string"&&typeof i.path=="string"&&typeof i.query=="string"&&typeof i.scheme=="string"&&typeof i.fsPath=="string"&&typeof i.with=="function"&&typeof i.toString=="function":!1}constructor(i,r,a,E,v,u=!1){typeof i=="object"?(this.scheme=i.scheme||P,this.authority=i.authority||P,this.path=i.path||P,this.query=i.query||P,this.fragment=i.fragment||P):(this.scheme=b(i,u),this.authority=r||P,this.path=S(this.scheme,a||P),this.query=E||P,this.fragment=v||P,D(this,u))}get fsPath(){return y(this,!1)}with(i){if(!i)return this;let{scheme:r,authority:a,path:E,query:v,fragment:u}=i;return r===void 0?r=this.scheme:r===null&&(r=P),a===void 0?a=this.authority:a===null&&(a=P),E===void 0?E=this.path:E===null&&(E=P),v===void 0?v=this.query:v===null&&(v=P),u===void 0?u=this.fragment:u===null&&(u=P),r===this.scheme&&a===this.authority&&E===this.path&&v===this.query&&u===this.fragment?this:new l(r,a,E,v,u)}static parse(i,r=!1){const a=g.exec(i);return a?new l(a[2]||P,n(a[4]||P),n(a[5]||P),n(a[7]||P),n(a[9]||P),r):new l(P,P,P,P,P)}static file(i){let r=P;if(O.isWindows&&(i=i.replace(/\\/g,p)),i[0]===p&&i[1]===p){const a=i.indexOf(p,2);a===-1?(r=i.substring(2),i=p):(r=i.substring(2,a),i=i.substring(a)||p)}return new l("file",r,i,P,P)}static from(i,r){return new l(i.scheme,i.authority,i.path,i.query,i.fragment,r)}static joinPath(i,...r){if(!i.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let a;return O.isWindows&&i.scheme==="file"?a=h.file(I.win32.join(y(i,!0),...r)).path:a=I.posix.join(i.path,...r),i.with({path:a})}toString(i=!1){return T(this,i)}toJSON(){return this}static revive(i){if(i){if(i instanceof h)return i;{const r=new l(i);return r._formatted=i.external??null,r._fsPath=i._sep===w?i.fsPath??null:null,r}}else return}}e.URI=h;function f(s){return!s||typeof s!="object"?!1:typeof s.scheme=="string"&&(typeof s.authority=="string"||typeof s.authority>"u")&&(typeof s.path=="string"||typeof s.path>"u")&&(typeof s.query=="string"||typeof s.query>"u")&&(typeof s.fragment=="string"||typeof s.fragment>"u")}e.isUriComponents=f;const w=O.isWindows?1:void 0;class l extends h{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(i=!1){return i?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){const i={$mid:1};return this._fsPath&&(i.fsPath=this._fsPath,i._sep=w),this._formatted&&(i.external=this._formatted),this.path&&(i.path=this.path),this.scheme&&(i.scheme=this.scheme),this.authority&&(i.authority=this.authority),this.query&&(i.query=this.query),this.fragment&&(i.fragment=this.fragment),i}}const d={[58]:"%3A",[47]:"%2F",[63]:"%3F",[35]:"%23",[91]:"%5B",[93]:"%5D",[64]:"%40",[33]:"%21",[36]:"%24",[38]:"%26",[39]:"%27",[40]:"%28",[41]:"%29",[42]:"%2A",[43]:"%2B",[44]:"%2C",[59]:"%3B",[61]:"%3D",[32]:"%20"};function c(s,i,r){let a,E=-1;for(let v=0;v<s.length;v++){const u=s.charCodeAt(v);if(u>=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45||u===46||u===95||u===126||i&&u===47||r&&u===91||r&&u===93||r&&u===58)E!==-1&&(a+=encodeURIComponent(s.substring(E,v)),E=-1),a!==void 0&&(a+=s.charAt(v));else{a===void 0&&(a=s.substr(0,v));const C=d[u];C!==void 0?(E!==-1&&(a+=encodeURIComponent(s.substring(E,v)),E=-1),a+=C):E===-1&&(E=v)}}return E!==-1&&(a+=encodeURIComponent(s.substring(E))),a!==void 0?a:s}function m(s){let i;for(let r=0;r<s.length;r++){const a=s.charCodeAt(r);a===35||a===63?(i===void 0&&(i=s.substr(0,r)),i+=d[a]):i!==void 0&&(i+=s[r])}return i!==void 0?i:s}function y(s,i){let r;return s.authority&&s.path.length>1&&s.scheme==="file"?r=`//${s.authority}${s.path}`:s.path.charCodeAt(0)===47&&(s.path.charCodeAt(1)>=65&&s.path.charCodeAt(1)<=90||s.path.charCodeAt(1)>=97&&s.path.charCodeAt(1)<=122)&&s.path.charCodeAt(2)===58?i?r=s.path.substr(1):r=s.path[1].toLowerCase()+s.path.substr(2):r=s.path,O.isWindows&&(r=r.replace(/\//g,"\\")),r}e.uriToFsPath=y;function T(s,i){const r=i?m:c;let a="",{scheme:E,authority:v,path:u,query:C,fragment:U}=s;if(E&&(a+=E,a+=":"),(v||E==="file")&&(a+=p,a+=p),v){let F=v.indexOf("@");if(F!==-1){const M=v.substr(0,F);v=v.substr(F+1),F=M.lastIndexOf(":"),F===-1?a+=r(M,!1,!1):(a+=r(M.substr(0,F),!1,!1),a+=":",a+=r(M.substr(F+1),!1,!0)),a+="@"}v=v.toLowerCase(),F=v.lastIndexOf(":"),F===-1?a+=r(v,!1,!0):(a+=r(v.substr(0,F),!1,!0),a+=v.substr(F))}if(u){if(u.length>=3&&u.charCodeAt(0)===47&&u.charCodeAt(2)===58){const F=u.charCodeAt(1);F>=65&&F<=90&&(u=`/${String.fromCharCode(F+32)}:${u.substr(3)}`)}else if(u.length>=2&&u.charCodeAt(1)===58){const F=u.charCodeAt(0);F>=65&&F<=90&&(u=`${String.fromCharCode(F+32)}:${u.substr(2)}`)}a+=r(u,!0,!1)}return C&&(a+="?",a+=r(C,!1,!1)),U&&(a+="#",a+=i?U:c(U,!1,!1)),a}function t(s){try{return decodeURIComponent(s)}catch{return s.length>3?s.substr(0,3)+t(s.substr(3)):s}}const o=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function n(s){return s.match(o)?s.replace(o,i=>t(i)):s}}),define(ce[142],le([0,1,11]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.getFirstFrame=e.parse=e.isRemoteConsoleLog=void 0;function O(S){const P=S;return P&&typeof P.type=="string"&&typeof P.severity=="string"}e.isRemoteConsoleLog=O;function A(S){const P=[];let p;try{const g=JSON.parse(S.arguments),h=g[g.length-1];h&&h.__$stack&&(g.pop(),p=h.__$stack),P.push(...g)}catch{P.push("Unable to log remote console arguments",S.arguments)}return{args:P,stack:p}}e.parse=A;function _(S){if(typeof S!="string")return _(A(S).stack);const P=S;if(P){const p=k(P),g=/at [^\/]*((?:(?:[a-zA-Z]+:)|(?:[\/])|(?:\\\\))(?:.+)):(\d+):(\d+)/.exec(p||"");if(g&&g.length===4)return{uri:I.URI.file(g[1]),line:Number(g[2]),column:Number(g[3])}}}e.getFirstFrame=_;function k(S){if(!S)return S;const P=S.indexOf(`
`);return P===-1?S:S.substring(0,P)}function D(S,P){const{args:p,stack:g}=A(S),h=typeof p[0]=="string"&&p.length===1;let f=k(g);f&&(f=`(${f.trim()})`);let w=[];if(typeof p[0]=="string"?f&&h?w=[`%c[${P}] %c${p[0]} %c${f}`,b("blue"),b(""),b("grey")]:w=[`%c[${P}] %c${p[0]}`,b("blue"),b(""),...p.slice(1)]:w=[`%c[${P}]%`,b("blue"),...p],f&&!h&&w.push(f),typeof console[S.severity]!="function")throw new Error("Unknown console method");console[S.severity].apply(console,w)}e.log=D;function b(S){return`color: ${S}`}}),define(ce[62],le([0,1,14,11]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.revive=e.parse=e.stringify=void 0;function A(b){return JSON.stringify(b,k)}e.stringify=A;function _(b){let S=JSON.parse(b);return S=D(S),S}e.parse=_;function k(b,S){return S instanceof RegExp?{$mid:2,source:S.source,flags:S.flags}:S}function D(b,S=0){if(!b||S>200)return b;if(typeof b=="object"){switch(b.$mid){case 1:return O.URI.revive(b);case 2:return new RegExp(b.source,b.flags);case 16:return new Date(b.source)}if(b instanceof I.VSBuffer||b instanceof Uint8Array)return b;if(Array.isArray(b))for(let P=0;P<b.length;++P)b[P]=D(b[P],S+1);else for(const P in b)Object.hasOwnProperty.call(b,P)&&(b[P]=D(b[P],S+1))}return b}e.revive=D}),define(ce[26],le([0,1,8,6,11]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.COI=e.FileAccess=e.nodeModulesAsarUnpackedPath=e.nodeModulesAsarPath=e.nodeModulesPath=e.builtinExtensionsPath=e.RemoteAuthorities=e.connectionTokenQueryName=e.connectionTokenCookieName=e.Schemas=void 0;var _;(function(S){S.inMemory="inmemory",S.vscode="vscode",S.internal="private",S.walkThrough="walkThrough",S.walkThroughSnippet="walkThroughSnippet",S.http="http",S.https="https",S.file="file",S.mailto="mailto",S.untitled="untitled",S.data="data",S.attachment="attachment",S.command="command",S.vscodeRemote="vscode-remote",S.vscodeRemoteResource="vscode-remote-resource",S.vscodeManagedRemoteResource="vscode-managed-remote-resource",S.vscodeUserData="vscode-userdata",S.vscodeCustomEditor="vscode-custom-editor",S.vscodeNotebookCell="vscode-notebook-cell",S.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",S.vscodeNotebookCellOutput="vscode-notebook-cell-output",S.vscodeInteractiveInput="vscode-interactive-input",S.vscodeSettings="vscode-settings",S.vscodeWorkspaceTrust="vscode-workspace-trust",S.vscodeTerminal="vscode-terminal",S.vscodeChatSesssion="vscode-chat-editor",S.webviewPanel="webview-panel",S.vscodeWebview="vscode-webview",S.extension="extension",S.vscodeFileResource="vscode-file",S.tmp="tmp",S.vsls="vsls",S.vscodeSourceControl="vscode-scm"})(_||(e.Schemas=_={})),e.connectionTokenCookieName="vscode-tkn",e.connectionTokenQueryName="tkn";class k{constructor(){this._defaultWebPort=80,this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${_.vscodeRemoteResource}`}setPreferredWebSchema(P){this._preferredWebSchema=P}setDelegate(P){this._delegate=P}setServerRootPath(P){this._remoteResourcesPath=`${P}/${_.vscodeRemoteResource}`}set(P,p,g){this._hosts[P]=p,this._ports[P]=g}setConnectionToken(P,p){this._connectionTokens[P]=p}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(P){if(this._delegate)try{return this._delegate(P)}catch(l){return I.onUnexpectedError(l),P}const p=P.authority;let g=this._hosts[p];g&&g.indexOf(":")!==-1&&g.indexOf("[")===-1&&(g=`[${g}]`);const h=this._ports[p],f=this._connectionTokens[p];let w=`path=${encodeURIComponent(P.path)}`;return typeof f=="string"&&(w+=`&${e.connectionTokenQueryName}=${encodeURIComponent(f)}`),A.URI.from({scheme:O.isWeb?this._preferredWebSchema:_.vscodeRemoteResource,authority:O.isWeb&&h===this._defaultWebPort?`${g}`:`${g}:${h}`,path:this._remoteResourcesPath,query:w})}}e.RemoteAuthorities=new k,e.builtinExtensionsPath="vs/../../extensions",e.nodeModulesPath="vs/../../node_modules",e.nodeModulesAsarPath="vs/../../node_modules.asar",e.nodeModulesAsarUnpackedPath="vs/../../node_modules.asar.unpacked";class D{static{this.FALLBACK_AUTHORITY="vscode-app"}asBrowserUri(P){const p=this.toUri(P,te);return this.uriToBrowserUri(p)}uriToBrowserUri(P){return P.scheme===_.vscodeRemote?e.RemoteAuthorities.rewrite(P):P.scheme===_.file&&(O.isNative||O.isWebWorker&&O.globals.origin===`${_.vscodeFileResource}://${D.FALLBACK_AUTHORITY}`)?P.with({scheme:_.vscodeFileResource,authority:P.authority||D.FALLBACK_AUTHORITY,query:null,fragment:null}):P}asFileUri(P){const p=this.toUri(P,te);return this.uriToFileUri(p)}uriToFileUri(P){return P.scheme===_.vscodeFileResource?P.with({scheme:_.file,authority:P.authority!==D.FALLBACK_AUTHORITY?P.authority:null,query:null,fragment:null}):P}toUri(P,p){return A.URI.isUri(P)?P:A.URI.parse(p.toUrl(P))}}e.FileAccess=new D;var b;(function(S){const P=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);S.CoopAndCoep=Object.freeze(P.get("3"));const p="vscode-coi";function g(f){let w;typeof f=="string"?w=new URL(f).searchParams:f instanceof URL?w=f.searchParams:A.URI.isUri(f)&&(w=new URL(f.toString(!0)).searchParams);const l=w?.get(p);if(l)return P.get(l)}S.getHeadersFromQuery=g;function h(f,w,l){if(!globalThis.crossOriginIsolated)return;const d=w&&l?"3":l?"2":"1";f instanceof URLSearchParams?f.set(p,d):f[p]=d}S.addSearchParam=h})(b||(e.COI=b={}))}),define(ce[143],le([0,1,125,26,6,11]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.importAMDNodeModule=void 0;class k{constructor(g,h,f){this.id=g,this.dependencies=h,this.callback=f}}class D{static{this.INSTANCE=new D}constructor(){this._isWebWorker=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",this._isRenderer=typeof document=="object",this._defineCalls=[],this._initialized=!1}_initialize(){this._initialized||(this._initialized=!0,globalThis.define=(g,h,f)=>{typeof g!="string"&&(f=h,h=g,g=null),(typeof h!="object"||!Array.isArray(h))&&(f=h,h=null),this._defineCalls.push(new k(g,h,f))},globalThis.define.amd=!0,this._isRenderer?this._amdPolicy=window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(g){if(g.startsWith(window.location.origin)||g.startsWith("vscode-file://vscode-app"))return g;throw new Error(`[trusted_script_src] Invalid script url: ${g}`)}}):this._isWebWorker&&(this._amdPolicy=globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(g){return g}})))}async load(g){this._initialize();const h=await(this._isWebWorker?this._workerLoadScript(g):this._isRenderer?this._rendererLoadScript(g):this._nodeJSLoadScript(g));if(!h)throw new Error(`Did not receive a define call from script ${g}`);if(Array.isArray(h.dependencies)&&h.dependencies.length>0)throw new Error(`Cannot resolve dependencies for script ${g}. The dependencies are: ${h.dependencies.join(", ")}`);return typeof h.callback=="function"?h.callback([]):h.callback}_rendererLoadScript(g){return new Promise((h,f)=>{const w=document.createElement("script");w.setAttribute("async","async"),w.setAttribute("type","text/javascript");const l=()=>{w.removeEventListener("load",d),w.removeEventListener("error",c)},d=m=>{l(),h(this._defineCalls.pop())},c=m=>{l(),f(m)};w.addEventListener("load",d),w.addEventListener("error",c),this._amdPolicy&&(g=this._amdPolicy.createScriptURL(g)),w.setAttribute("src",g),document.getElementsByTagName("head")[0].appendChild(w)})}_workerLoadScript(g){return new Promise((h,f)=>{try{this._amdPolicy&&(g=this._amdPolicy.createScriptURL(g)),importScripts(g),h(this._defineCalls.pop())}catch(w){f(w)}})}async _nodeJSLoadScript(g){try{const h=globalThis._VSCODE_NODE_MODULES.fs,f=globalThis._VSCODE_NODE_MODULES.vm,w=globalThis._VSCODE_NODE_MODULES.module,l=_.URI.parse(g).fsPath,d=h.readFileSync(l).toString(),c=w.wrap(d.replace(/^#!.*/,""));return new f.Script(c).runInThisContext().apply(),this._defineCalls.pop()}catch(h){throw h}}}const b=new Map;let S={};typeof globalThis.require=="object"&&(S=globalThis.require.paths??{});async function P(p,g,h){if(I.isESM){h===void 0&&(h=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit),S[p]&&(p=S[p]);const f=`${p}/${g}`;if(b.has(f))return b.get(f);let w;if(/^\w[\w\d+.-]*:\/\//.test(f))w=f;else{const m=`${h&&!A.isWeb?O.nodeModulesAsarPath:O.nodeModulesPath}/${f}`;w=O.FileAccess.asBrowserUri(m).toString(!0)}const l=D.INSTANCE.load(w);return b.set(f,l),l}else return await new Promise((f,w)=>{te([p],f,w)})}e.importAMDNodeModule=P}),define(ce[22],le([0,1,48,26,16,6,28,11]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toLocalResource=e.DataUri=e.distinctParents=e.addTrailingPathSeparator=e.removeTrailingPathSeparator=e.hasTrailingPathSeparator=e.isEqualAuthority=e.isAbsolutePath=e.resolvePath=e.relativePath=e.normalizePath=e.joinPath=e.dirname=e.extname=e.basename=e.basenameOrAuthority=e.getComparisonKey=e.isEqualOrParent=e.isEqual=e.extUriIgnorePathCase=e.extUriBiasedIgnorePathCase=e.extUri=e.ExtUri=e.originalFSPath=void 0;function b(h){return(0,D.uriToFsPath)(h,!0)}e.originalFSPath=b;class S{constructor(f){this._ignorePathCasing=f}compare(f,w,l=!1){return f===w?0:(0,k.compare)(this.getComparisonKey(f,l),this.getComparisonKey(w,l))}isEqual(f,w,l=!1){return f===w?!0:!f||!w?!1:this.getComparisonKey(f,l)===this.getComparisonKey(w,l)}getComparisonKey(f,w=!1){return f.with({path:this._ignorePathCasing(f)?f.path.toLowerCase():void 0,fragment:w?null:void 0}).toString()}ignorePathCasing(f){return this._ignorePathCasing(f)}isEqualOrParent(f,w,l=!1){if(f.scheme===w.scheme){if(f.scheme===O.Schemas.file)return I.isEqualOrParent(b(f),b(w),this._ignorePathCasing(f))&&f.query===w.query&&(l||f.fragment===w.fragment);if((0,e.isEqualAuthority)(f.authority,w.authority))return I.isEqualOrParent(f.path,w.path,this._ignorePathCasing(f),"/")&&f.query===w.query&&(l||f.fragment===w.fragment)}return!1}joinPath(f,...w){return D.URI.joinPath(f,...w)}basenameOrAuthority(f){return(0,e.basename)(f)||f.authority}basename(f){return A.posix.basename(f.path)}extname(f){return A.posix.extname(f.path)}dirname(f){if(f.path.length===0)return f;let w;return f.scheme===O.Schemas.file?w=D.URI.file(A.dirname(b(f))).path:(w=A.posix.dirname(f.path),f.authority&&w.length&&w.charCodeAt(0)!==47&&(console.error(`dirname("${f.toString})) resulted in a relative path`),w="/")),f.with({path:w})}normalizePath(f){if(!f.path.length)return f;let w;return f.scheme===O.Schemas.file?w=D.URI.file(A.normalize(b(f))).path:w=A.posix.normalize(f.path),f.with({path:w})}relativePath(f,w){if(f.scheme!==w.scheme||!(0,e.isEqualAuthority)(f.authority,w.authority))return;if(f.scheme===O.Schemas.file){const c=A.relative(b(f),b(w));return _.isWindows?I.toSlashes(c):c}let l=f.path||"/";const d=w.path||"/";if(this._ignorePathCasing(f)){let c=0;for(const m=Math.min(l.length,d.length);c<m&&!(l.charCodeAt(c)!==d.charCodeAt(c)&&l.charAt(c).toLowerCase()!==d.charAt(c).toLowerCase());c++);l=d.substr(0,c)+l.substr(c)}return A.posix.relative(l,d)}resolvePath(f,w){if(f.scheme===O.Schemas.file){const l=D.URI.file(A.resolve(b(f),w));return f.with({authority:l.authority,path:l.path})}return w=I.toPosixPath(w),f.with({path:A.posix.resolve(f.path,w)})}isAbsolutePath(f){return!!f.path&&f.path[0]==="/"}isEqualAuthority(f,w){return f===w||f!==void 0&&w!==void 0&&(0,k.equalsIgnoreCase)(f,w)}hasTrailingPathSeparator(f,w=A.sep){if(f.scheme===O.Schemas.file){const l=b(f);return l.length>I.getRoot(l).length&&l[l.length-1]===w}else{const l=f.path;return l.length>1&&l.charCodeAt(l.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(f.fsPath)}}removeTrailingPathSeparator(f,w=A.sep){return(0,e.hasTrailingPathSeparator)(f,w)?f.with({path:f.path.substr(0,f.path.length-1)}):f}addTrailingPathSeparator(f,w=A.sep){let l=!1;if(f.scheme===O.Schemas.file){const d=b(f);l=d!==void 0&&d.length===I.getRoot(d).length&&d[d.length-1]===w}else{w="/";const d=f.path;l=d.length===1&&d.charCodeAt(d.length-1)===47}return!l&&!(0,e.hasTrailingPathSeparator)(f,w)?f.with({path:f.path+"/"}):f}}e.ExtUri=S,e.extUri=new S(()=>!1),e.extUriBiasedIgnorePathCase=new S(h=>h.scheme===O.Schemas.file?!_.isLinux:!0),e.extUriIgnorePathCase=new S(h=>!0),e.isEqual=e.extUri.isEqual.bind(e.extUri),e.isEqualOrParent=e.extUri.isEqualOrParent.bind(e.extUri),e.getComparisonKey=e.extUri.getComparisonKey.bind(e.extUri),e.basenameOrAuthority=e.extUri.basenameOrAuthority.bind(e.extUri),e.basename=e.extUri.basename.bind(e.extUri),e.extname=e.extUri.extname.bind(e.extUri),e.dirname=e.extUri.dirname.bind(e.extUri),e.joinPath=e.extUri.joinPath.bind(e.extUri),e.normalizePath=e.extUri.normalizePath.bind(e.extUri),e.relativePath=e.extUri.relativePath.bind(e.extUri),e.resolvePath=e.extUri.resolvePath.bind(e.extUri),e.isAbsolutePath=e.extUri.isAbsolutePath.bind(e.extUri),e.isEqualAuthority=e.extUri.isEqualAuthority.bind(e.extUri),e.hasTrailingPathSeparator=e.extUri.hasTrailingPathSeparator.bind(e.extUri),e.removeTrailingPathSeparator=e.extUri.removeTrailingPathSeparator.bind(e.extUri),e.addTrailingPathSeparator=e.extUri.addTrailingPathSeparator.bind(e.extUri);function P(h,f){const w=[];for(let l=0;l<h.length;l++){const d=f(h[l]);h.some((c,m)=>m===l?!1:(0,e.isEqualOrParent)(d,f(c)))||w.push(h[l])}return w}e.distinctParents=P;var p;(function(h){h.META_DATA_LABEL="label",h.META_DATA_DESCRIPTION="description",h.META_DATA_SIZE="size",h.META_DATA_MIME="mime";function f(w){const l=new Map;w.path.substring(w.path.indexOf(";")+1,w.path.lastIndexOf(";")).split(";").forEach(m=>{const[y,T]=m.split(":");y&&T&&l.set(y,T)});const c=w.path.substring(0,w.path.indexOf(";"));return c&&l.set(h.META_DATA_MIME,c),l}h.parseMetaData=f})(p||(e.DataUri=p={}));function g(h,f,w){if(f){let l=h.path;return l&&l[0]!==A.posix.sep&&(l=A.posix.sep+l),h.with({scheme:w,authority:f,path:l})}return h.with({scheme:w})}e.toLocalResource=g}),define(ce[5],le([0,1,25,8,3,2,22,6,129]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createCancelableAsyncIterable=e.CancelableAsyncIterableObject=e.AsyncIterableObject=e.Promises=e.DeferredPromise=e.IntervalCounter=e.TaskSequentializer=e.retry=e.IdleValue=e.runWhenIdle=e.ThrottledWorker=e.RunOnceWorker=e.ProcessTimeRunOnceScheduler=e.RunOnceScheduler=e.IntervalTimer=e.TimeoutTimer=e.ResourceQueue=e.LimitedQueue=e.Queue=e.Limiter=e.firstParallel=e.first=e.sequence=e.disposableTimeout=e.timeout=e.AutoOpenBarrier=e.Barrier=e.ThrottledDelayer=e.Delayer=e.SequencerByKey=e.Sequencer=e.Throttler=e.asPromise=e.raceTimeout=e.raceCancellablePromises=e.raceCancellationError=e.raceCancellation=e.createCancelablePromise=e.isThenable=void 0;function S(R){return!!R&&typeof R.then=="function"}e.isThenable=S;function P(R){const L=new I.CancellationTokenSource,N=R(L.token),W=new Promise((X,ne)=>{const re=L.token.onCancellationRequested(()=>{re.dispose(),L.dispose(),ne(new O.CancellationError)});Promise.resolve(N).then(Q=>{re.dispose(),L.dispose(),X(Q)},Q=>{re.dispose(),L.dispose(),ne(Q)})});return new class{cancel(){L.cancel()}then(X,ne){return W.then(X,ne)}catch(X){return this.then(void 0,X)}finally(X){return W.finally(X)}}}e.createCancelablePromise=P;function p(R,L,N){return new Promise((W,X)=>{const ne=L.onCancellationRequested(()=>{ne.dispose(),W(N)});R.then(W,X).finally(()=>ne.dispose())})}e.raceCancellation=p;function g(R,L){return new Promise((N,W)=>{const X=L.onCancellationRequested(()=>{X.dispose(),W(new O.CancellationError)});R.then(N,W).finally(()=>X.dispose())})}e.raceCancellationError=g;async function h(R){let L=-1;const N=R.map((W,X)=>W.then(ne=>(L=X,ne)));try{return await Promise.race(N)}finally{R.forEach((W,X)=>{X!==L&&W.cancel()})}}e.raceCancellablePromises=h;function f(R,L,N){let W;const X=setTimeout(()=>{W?.(void 0),N?.()},L);return Promise.race([R.finally(()=>clearTimeout(X)),new Promise(ne=>W=ne)])}e.raceTimeout=f;function w(R){return new Promise((L,N)=>{const W=R();S(W)?W.then(L,N):L(W)})}e.asPromise=w;class l{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(L){if(this.isDisposed)throw new Error("Throttler is disposed");if(this.activePromise){if(this.queuedPromiseFactory=L,!this.queuedPromise){const N=()=>{if(this.queuedPromise=null,this.isDisposed)return;const W=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,W};this.queuedPromise=new Promise(W=>{this.activePromise.then(N,N).then(W)})}return new Promise((N,W)=>{this.queuedPromise.then(N,W)})}return this.activePromise=L(),new Promise((N,W)=>{this.activePromise.then(X=>{this.activePromise=null,N(X)},X=>{this.activePromise=null,W(X)})})}dispose(){this.isDisposed=!0}}e.Throttler=l;class d{constructor(){this.current=Promise.resolve(null)}queue(L){return this.current=this.current.then(()=>L(),()=>L())}}e.Sequencer=d;class c{constructor(){this.promiseMap=new Map}queue(L,N){const X=(this.promiseMap.get(L)??Promise.resolve()).catch(()=>{}).then(N).finally(()=>{this.promiseMap.get(L)===X&&this.promiseMap.delete(L)});return this.promiseMap.set(L,X),X}}e.SequencerByKey=c;const m=(R,L)=>{let N=!0;const W=setTimeout(()=>{N=!1,L()},R);return{isTriggered:()=>N,dispose:()=>{clearTimeout(W),N=!1}}},y=R=>{let L=!0;return queueMicrotask(()=>{L&&(L=!1,R())}),{isTriggered:()=>L,dispose:()=>{L=!1}}};class T{constructor(L){this.defaultDelay=L,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(L,N=this.defaultDelay){this.task=L,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((X,ne)=>{this.doResolve=X,this.doReject=ne}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const X=this.task;return this.task=null,X()}}));const W=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=N===b.MicrotaskDelay?y(W):m(N,W),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject?.(new O.CancellationError),this.completionPromise=null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}}e.Delayer=T;class t{constructor(L){this.delayer=new T(L),this.throttler=new l}trigger(L,N){return this.delayer.trigger(()=>this.throttler.queue(L),N)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}e.ThrottledDelayer=t;class o{constructor(){this._isOpen=!1,this._promise=new Promise((L,N)=>{this._completePromise=L})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}}e.Barrier=o;class n extends o{constructor(L){super(),this._timeout=setTimeout(()=>this.open(),L)}open(){clearTimeout(this._timeout),super.open()}}e.AutoOpenBarrier=n;function s(R,L){return L?new Promise((N,W)=>{const X=setTimeout(()=>{ne.dispose(),N()},R),ne=L.onCancellationRequested(()=>{clearTimeout(X),ne.dispose(),W(new O.CancellationError)})}):P(N=>s(R,N))}e.timeout=s;function i(R,L=0){const N=setTimeout(R,L);return(0,_.toDisposable)(()=>clearTimeout(N))}e.disposableTimeout=i;function r(R){const L=[];let N=0;const W=R.length;function X(){return N<W?R[N++]():null}function ne(re){re!=null&&L.push(re);const Q=X();return Q?Q.then(ne):Promise.resolve(L)}return Promise.resolve(null).then(ne)}e.sequence=r;function a(R,L=W=>!!W,N=null){let W=0;const X=R.length,ne=()=>{if(W>=X)return Promise.resolve(N);const re=R[W++];return Promise.resolve(re()).then(ee=>L(ee)?Promise.resolve(ee):ne())};return ne()}e.first=a;function E(R,L=W=>!!W,N=null){if(R.length===0)return Promise.resolve(N);let W=R.length;const X=()=>{W=-1;for(const ne of R)ne.cancel?.()};return new Promise((ne,re)=>{for(const Q of R)Q.then(ee=>{--W>=0&&L(ee)?(X(),ne(ee)):W===0&&ne(N)}).catch(ee=>{--W>=0&&(X(),re(ee))})})}e.firstParallel=E;class v{constructor(L){this._size=0,this.maxDegreeOfParalellism=L,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new A.Emitter}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(L){return this._size++,new Promise((N,W)=>{this.outstandingPromises.push({factory:L,c:N,e:W}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){const L=this.outstandingPromises.shift();this.runningPromises++;const N=L.factory();N.then(L.c,L.e),N.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._size--,this.runningPromises--,this.outstandingPromises.length>0?this.consume():this._onDrained.fire()}dispose(){this._onDrained.dispose()}}e.Limiter=v;class u extends v{constructor(){super(1)}}e.Queue=u;class C{constructor(){this.sequentializer=new K,this.tasks=0}queue(L){return this.sequentializer.isRunning()?this.sequentializer.queue(()=>this.sequentializer.run(this.tasks++,L())):this.sequentializer.run(this.tasks++,L())}}e.LimitedQueue=C;class U{constructor(){this.queues=new Map,this.drainers=new Set}async whenDrained(){if(this.isDrained())return;const L=new j;return this.drainers.add(L),L.p}isDrained(){for(const[,L]of this.queues)if(L.size>0)return!1;return!0}queueFor(L,N=k.extUri){const W=N.getComparisonKey(L);let X=this.queues.get(W);return X||(X=new u,A.Event.once(X.onDrained)(()=>{X?.dispose(),this.queues.delete(W),this.onDidQueueDrain()}),this.queues.set(W,X)),X}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(const L of this.drainers)L.complete();this.drainers.clear()}dispose(){for(const[,L]of this.queues)L.dispose();this.queues.clear(),this.releaseDrainers()}}e.ResourceQueue=U;class F{constructor(L,N){this._token=-1,typeof L=="function"&&typeof N=="number"&&this.setIfNotSet(L,N)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(L,N){this.cancel(),this._token=setTimeout(()=>{this._token=-1,L()},N)}setIfNotSet(L,N){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,L()},N))}}e.TimeoutTimer=F;class M{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(L,N){this.cancel(),this._token=setInterval(()=>{L()},N)}}e.IntervalTimer=M;class z{constructor(L,N){this.timeoutToken=-1,this.runner=L,this.timeout=N,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(L=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,L)}get delay(){return this.timeout}set delay(L){this.timeout=L}isScheduled(){return this.timeoutToken!==-1}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){this.runner?.()}}e.RunOnceScheduler=z;class V{constructor(L,N){N%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${N}ms is not a multiple of 1000ms.`),this.runner=L,this.timeout=N,this.counter=0,this.intervalToken=-1,this.intervalHandler=this.onInterval.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearInterval(this.intervalToken),this.intervalToken=-1)}schedule(L=this.timeout){L%1e3!==0&&console.warn(`ProcessTimeRunOnceScheduler resolution is 1s, ${L}ms is not a multiple of 1000ms.`),this.cancel(),this.counter=Math.ceil(L/1e3),this.intervalToken=setInterval(this.intervalHandler,1e3)}isScheduled(){return this.intervalToken!==-1}onInterval(){this.counter--,!(this.counter>0)&&(clearInterval(this.intervalToken),this.intervalToken=-1,this.runner?.())}}e.ProcessTimeRunOnceScheduler=V;class J extends z{constructor(L,N){super(L,N),this.units=[]}work(L){this.units.push(L),this.isScheduled()||this.schedule()}doRun(){const L=this.units;this.units=[],this.runner?.(L)}dispose(){this.units=[],super.dispose()}}e.RunOnceWorker=J;class H extends _.Disposable{constructor(L,N){super(),this.options=L,this.handler=N,this.pendingWork=[],this.throttler=this._register(new _.MutableDisposable),this.disposed=!1}get pending(){return this.pendingWork.length}work(L){if(this.disposed)return!1;if(typeof this.options.maxBufferedWork=="number"){if(this.throttler.value){if(this.pending+L.length>this.options.maxBufferedWork)return!1}else if(this.pending+L.length-this.options.maxWorkChunkSize>this.options.maxBufferedWork)return!1}for(const N of L)this.pendingWork.push(N);return this.throttler.value||this.doWork(),!0}doWork(){this.handler(this.pendingWork.splice(0,this.options.maxWorkChunkSize)),this.pendingWork.length>0&&(this.throttler.value=new z(()=>{this.throttler.clear(),this.doWork()},this.options.throttleDelay),this.throttler.value.schedule())}dispose(){super.dispose(),this.disposed=!0}}e.ThrottledWorker=H,function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?e.runWhenIdle=R=>{(0,D.setTimeout0)(()=>{if(L)return;const N=Date.now()+15;R(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,N-Date.now())}}))});let L=!1;return{dispose(){L||(L=!0)}}}:e.runWhenIdle=(R,L)=>{const N=requestIdleCallback(R,typeof L=="number"?{timeout:L}:void 0);let W=!1;return{dispose(){W||(W=!0,cancelIdleCallback(N))}}}}();class Y{constructor(L){this._didRun=!1,this._executor=()=>{try{this._value=L()}catch(N){this._error=N}finally{this._didRun=!0}},this._handle=(0,e.runWhenIdle)(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}e.IdleValue=Y;async function B(R,L,N){let W;for(let X=0;X<N;X++)try{return await R()}catch(ne){W=ne,await s(L)}throw W}e.retry=B;class K{isRunning(L){return typeof L=="number"?this._running?.taskId===L:!!this._running}get running(){return this._running?.promise}cancelRunning(){this._running?.cancel()}run(L,N,W){return this._running={taskId:L,cancel:()=>W?.(),promise:N},N.then(()=>this.doneRunning(L),()=>this.doneRunning(L)),N}doneRunning(L){this._running&&L===this._running.taskId&&(this._running=void 0,this.runQueued())}runQueued(){if(this._queued){const L=this._queued;this._queued=void 0,L.run().then(L.promiseResolve,L.promiseReject)}}queue(L){if(this._queued)this._queued.run=L;else{let N,W;const X=new Promise((ne,re)=>{N=ne,W=re});this._queued={run:L,promise:X,promiseResolve:N,promiseReject:W}}return this._queued.promise}hasQueued(){return!!this._queued}async join(){return this._queued?.promise??this._running?.promise}}e.TaskSequentializer=K;class x{constructor(L,N=()=>Date.now()){this.interval=L,this.nowFn=N,this.lastIncrementTime=0,this.value=0}increment(){const L=this.nowFn();return L-this.lastIncrementTime>this.interval&&(this.lastIncrementTime=L,this.value=0),this.value++,this.value}}e.IntervalCounter=x;var q;(function(R){R[R.Resolved=0]="Resolved",R[R.Rejected=1]="Rejected"})(q||(q={}));class j{get isRejected(){return this.outcome?.outcome===1}get isResolved(){return this.outcome?.outcome===0}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===0?this.outcome?.value:void 0}constructor(){this.p=new Promise((L,N)=>{this.completeCallback=L,this.errorCallback=N})}complete(L){return new Promise(N=>{this.completeCallback(L),this.outcome={outcome:0,value:L},N()})}error(L){return new Promise(N=>{this.errorCallback(L),this.outcome={outcome:1,value:L},N()})}cancel(){return this.error(new O.CancellationError)}}e.DeferredPromise=j;var Z;(function(R){async function L(W){let X;const ne=await Promise.all(W.map(re=>re.then(Q=>Q,Q=>{X||(X=Q)})));if(typeof X<"u")throw X;return ne}R.settled=L;function N(W){return new Promise(async(X,ne)=>{try{await W(X,ne)}catch(re){ne(re)}})}R.withAsyncBody=N})(Z||(e.Promises=Z={}));var oe;(function(R){R[R.Initial=0]="Initial",R[R.DoneOK=1]="DoneOK",R[R.DoneError=2]="DoneError"})(oe||(oe={}));class ue{static fromArray(L){return new ue(N=>{N.emitMany(L)})}static fromPromise(L){return new ue(async N=>{N.emitMany(await L)})}static fromPromises(L){return new ue(async N=>{await Promise.all(L.map(async W=>N.emitOne(await W)))})}static merge(L){return new ue(async N=>{await Promise.all(L.map(async W=>{for await(const X of W)N.emitOne(X)}))})}static{this.EMPTY=ue.fromArray([])}constructor(L){this._state=0,this._results=[],this._error=null,this._onStateChanged=new A.Emitter,queueMicrotask(async()=>{const N={emitOne:W=>this.emitOne(W),emitMany:W=>this.emitMany(W),reject:W=>this.reject(W)};try{await Promise.resolve(L(N)),this.resolve()}catch(W){this.reject(W)}finally{N.emitOne=void 0,N.emitMany=void 0,N.reject=void 0}})}[Symbol.asyncIterator](){let L=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(L<this._results.length)return{done:!1,value:this._results[L++]};if(this._state===1)return{done:!0,value:void 0};await A.Event.toPromise(this._onStateChanged.event)}while(!0)}}}static map(L,N){return new ue(async W=>{for await(const X of L)W.emitOne(N(X))})}map(L){return ue.map(this,L)}static filter(L,N){return new ue(async W=>{for await(const X of L)N(X)&&W.emitOne(X)})}filter(L){return ue.filter(this,L)}static coalesce(L){return ue.filter(L,N=>!!N)}coalesce(){return ue.coalesce(this)}static async toPromise(L){const N=[];for await(const W of L)N.push(W);return N}toPromise(){return ue.toPromise(this)}emitOne(L){this._state===0&&(this._results.push(L),this._onStateChanged.fire())}emitMany(L){this._state===0&&(this._results=this._results.concat(L),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(L){this._state===0&&(this._state=2,this._error=L,this._onStateChanged.fire())}}e.AsyncIterableObject=ue;class ae extends ue{constructor(L,N){super(N),this._source=L}cancel(){this._source.cancel()}}e.CancelableAsyncIterableObject=ae;function $(R){const L=new I.CancellationTokenSource,N=R(L.token);return new ae(L,async W=>{const X=L.token.onCancellationRequested(()=>{X.dispose(),L.dispose(),W.reject(new O.CancellationError)});try{for await(const ne of N){if(L.token.isCancellationRequested)return;W.emitOne(ne)}X.dispose(),L.dispose()}catch(ne){X.dispose(),L.dispose(),W.reject(ne)}})}e.createCancelableAsyncIterable=$}),define(ce[93],le([0,1,20,5,48,35,16,6,28]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.patternsEquals=e.getPathTerms=e.getBasenameTerms=e.isRelativePattern=e.parse=e.match=e.splitGlobAware=e.GLOB_SPLIT=e.GLOBSTAR=e.getEmptyExpression=void 0;function S(){return Object.create(null)}e.getEmptyExpression=S,e.GLOBSTAR="**",e.GLOB_SPLIT="/";const P="[/\\\\]",p="[^/\\\\]",g=/\//g;function h(K,x){switch(K){case 0:return"";case 1:return`${p}*?`;default:return`(?:${P}|${p}+${P}${x?`|${P}${p}+`:""})*?`}}function f(K,x){if(!K)return[];const q=[];let j=!1,Z=!1,oe="";for(const ue of K){switch(ue){case x:if(!j&&!Z){q.push(oe),oe="";continue}break;case"{":j=!0;break;case"}":j=!1;break;case"[":Z=!0;break;case"]":Z=!1;break}oe+=ue}return oe&&q.push(oe),q}e.splitGlobAware=f;function w(K){if(!K)return"";let x="";const q=f(K,e.GLOB_SPLIT);if(q.every(j=>j===e.GLOBSTAR))x=".*";else{let j=!1;q.forEach((Z,oe)=>{if(Z===e.GLOBSTAR){if(j)return;x+=h(2,oe===q.length-1)}else{let ue=!1,ae="",$=!1,R="";for(const L of Z){if(L!=="}"&&ue){ae+=L;continue}if($&&(L!=="]"||!R)){let N;L==="-"?N=L:(L==="^"||L==="!")&&!R?N="^":L===e.GLOB_SPLIT?N="":N=(0,b.escapeRegExpCharacters)(L),R+=N;continue}switch(L){case"{":ue=!0;continue;case"[":$=!0;continue;case"}":{const W=`(?:${f(ae,",").map(X=>w(X)).join("|")})`;x+=W,ue=!1,ae="";break}case"]":{x+="["+R+"]",$=!1,R="";break}case"?":x+=p;continue;case"*":x+=h(1);continue;default:x+=(0,b.escapeRegExpCharacters)(L)}}oe<q.length-1&&(q[oe+1]!==e.GLOBSTAR||oe+2<q.length)&&(x+=P)}j=Z===e.GLOBSTAR})}return x}const l=/^\*\*\/\*\.[\w\.-]+$/,d=/^\*\*\/([\w\.-]+)\/?$/,c=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,m=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,y=/^\*\*((\/[\w\.-]+)+)\/?$/,T=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,t=new _.LRUCache(1e4),o=function(){return!1},n=function(){return null};function s(K,x){if(!K)return n;let q;typeof K!="string"?q=K.pattern:q=K,q=q.trim();const j=`${q}_${!!x.trimForExclusions}`;let Z=t.get(j);if(Z)return i(Z,K);let oe;return l.test(q)?Z=a(q.substr(4),q):(oe=d.exec(r(q,x)))?Z=E(oe[1],q):(x.trimForExclusions?m:c).test(q)?Z=v(q,x):(oe=y.exec(r(q,x)))?Z=u(oe[1].substr(1),q,!0):(oe=T.exec(r(q,x)))?Z=u(oe[1],q,!1):Z=C(q),t.set(j,Z),i(Z,K)}function i(K,x){if(typeof x=="string")return K;const q=function(j,Z){return(0,A.isEqualOrParent)(j,x.base,!D.isLinux)?K((0,b.ltrim)(j.substr(x.base.length),k.sep),Z):null};return q.allBasenames=K.allBasenames,q.allPaths=K.allPaths,q.basenames=K.basenames,q.patterns=K.patterns,q}function r(K,x){return x.trimForExclusions&&K.endsWith("/**")?K.substr(0,K.length-2):K}function a(K,x){return function(q,j){return typeof q=="string"&&q.endsWith(K)?x:null}}function E(K,x){const q=`/${K}`,j=`\\${K}`,Z=function(ue,ae){return typeof ue!="string"?null:ae?ae===K?x:null:ue===K||ue.endsWith(q)||ue.endsWith(j)?x:null},oe=[K];return Z.basenames=oe,Z.patterns=[x],Z.allBasenames=oe,Z}function v(K,x){const q=Y(K.slice(1,-1).split(",").map(ae=>s(ae,x)).filter(ae=>ae!==n),K),j=q.length;if(!j)return n;if(j===1)return q[0];const Z=function(ae,$){for(let R=0,L=q.length;R<L;R++)if(q[R](ae,$))return K;return null},oe=q.find(ae=>!!ae.allBasenames);oe&&(Z.allBasenames=oe.allBasenames);const ue=q.reduce((ae,$)=>$.allPaths?ae.concat($.allPaths):ae,[]);return ue.length&&(Z.allPaths=ue),Z}function u(K,x,q){const j=k.sep===k.posix.sep,Z=j?K:K.replace(g,k.sep),oe=k.sep+Z,ue=k.posix.sep+K;let ae;return q?ae=function($,R){return typeof $=="string"&&($===Z||$.endsWith(oe)||!j&&($===K||$.endsWith(ue)))?x:null}:ae=function($,R){return typeof $=="string"&&($===Z||!j&&$===K)?x:null},ae.allPaths=[(q?"*/":"./")+K],ae}function C(K){try{const x=new RegExp(`^${w(K)}$`);return function(q){return x.lastIndex=0,typeof q=="string"&&x.test(q)?K:null}}catch{return n}}function U(K,x,q){return!K||typeof x!="string"?!1:F(K)(x,void 0,q)}e.match=U;function F(K,x={}){if(!K)return o;if(typeof K=="string"||M(K)){const q=s(K,x);if(q===n)return o;const j=function(Z,oe){return!!q(Z,oe)};return q.allBasenames&&(j.allBasenames=q.allBasenames),q.allPaths&&(j.allPaths=q.allPaths),j}return J(K,x)}e.parse=F;function M(K){const x=K;return x?typeof x.base=="string"&&typeof x.pattern=="string":!1}e.isRelativePattern=M;function z(K){return K.allBasenames||[]}e.getBasenameTerms=z;function V(K){return K.allPaths||[]}e.getPathTerms=V;function J(K,x){const q=Y(Object.getOwnPropertyNames(K).map(ae=>H(ae,K[ae],x)).filter(ae=>ae!==n)),j=q.length;if(!j)return n;if(!q.some(ae=>!!ae.requiresSiblings)){if(j===1)return q[0];const ae=function(L,N){let W;for(let X=0,ne=q.length;X<ne;X++){const re=q[X](L,N);if(typeof re=="string")return re;(0,O.isThenable)(re)&&(W||(W=[]),W.push(re))}return W?(async()=>{for(const X of W){const ne=await X;if(typeof ne=="string")return ne}return null})():null},$=q.find(L=>!!L.allBasenames);$&&(ae.allBasenames=$.allBasenames);const R=q.reduce((L,N)=>N.allPaths?L.concat(N.allPaths):L,[]);return R.length&&(ae.allPaths=R),ae}const Z=function(ae,$,R){let L,N;for(let W=0,X=q.length;W<X;W++){const ne=q[W];ne.requiresSiblings&&R&&($||($=(0,k.basename)(ae)),L||(L=$.substr(0,$.length-(0,k.extname)(ae).length)));const re=ne(ae,$,L,R);if(typeof re=="string")return re;(0,O.isThenable)(re)&&(N||(N=[]),N.push(re))}return N?(async()=>{for(const W of N){const X=await W;if(typeof X=="string")return X}return null})():null},oe=q.find(ae=>!!ae.allBasenames);oe&&(Z.allBasenames=oe.allBasenames);const ue=q.reduce((ae,$)=>$.allPaths?ae.concat($.allPaths):ae,[]);return ue.length&&(Z.allPaths=ue),Z}function H(K,x,q){if(x===!1)return n;const j=s(K,q);if(j===n)return n;if(typeof x=="boolean")return j;if(x){const Z=x.when;if(typeof Z=="string"){const oe=(ue,ae,$,R)=>{if(!R||!j(ue,ae))return null;const L=Z.replace("$(basename)",()=>$),N=R(L);return(0,O.isThenable)(N)?N.then(W=>W?K:null):N?K:null};return oe.requiresSiblings=!0,oe}}return j}function Y(K,x){const q=K.filter(ae=>!!ae.basenames);if(q.length<2)return K;const j=q.reduce((ae,$)=>{const R=$.basenames;return R?ae.concat(R):ae},[]);let Z;if(x){Z=[];for(let ae=0,$=j.length;ae<$;ae++)Z.push(x)}else Z=q.reduce((ae,$)=>{const R=$.patterns;return R?ae.concat(R):ae},[]);const oe=function(ae,$){if(typeof ae!="string")return null;if(!$){let L;for(L=ae.length;L>0;L--){const N=ae.charCodeAt(L-1);if(N===47||N===92)break}$=ae.substr(L)}const R=j.indexOf($);return R!==-1?Z[R]:null};oe.basenames=j,oe.patterns=Z,oe.allBasenames=j;const ue=K.filter(ae=>!ae.basenames);return ue.push(oe),ue}function B(K,x){return(0,I.equals)(K,x,(q,j)=>typeof q=="string"&&typeof j=="string"?q===j:typeof q!="string"&&typeof j!="string"?q.base===j.base&&q.pattern===j.pattern:!1)}e.patternsEquals=B}),define(ce[94],le([0,1,14,11]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformAndReviveIncomingURIs=e.transformIncomingURIs=e.transformOutgoingURIs=e.DefaultURITransformer=e.URITransformer=void 0;function A(p){return p.toJSON()}class _{constructor(g){this._uriTransformer=g}transformIncoming(g){const h=this._uriTransformer.transformIncoming(g);return h===g?g:A(O.URI.from(h))}transformOutgoing(g){const h=this._uriTransformer.transformOutgoing(g);return h===g?g:A(O.URI.from(h))}transformOutgoingURI(g){const h=this._uriTransformer.transformOutgoing(g);return h===g?g:O.URI.from(h)}transformOutgoingScheme(g){return this._uriTransformer.transformOutgoingScheme(g)}}e.URITransformer=_,e.DefaultURITransformer=new class{transformIncoming(p){return p}transformOutgoing(p){return p}transformOutgoingURI(p){return p}transformOutgoingScheme(p){return p}};function k(p,g,h){if(!p||h>200)return null;if(typeof p=="object"){if(p instanceof O.URI)return g.transformOutgoing(p);for(const f in p)if(Object.hasOwnProperty.call(p,f)){const w=k(p[f],g,h+1);w!==null&&(p[f]=w)}}return null}function D(p,g){const h=k(p,g,0);return h===null?p:h}e.transformOutgoingURIs=D;function b(p,g,h,f){if(!p||f>200)return null;if(typeof p=="object"){if(p.$mid===1)return h?O.URI.revive(g.transformIncoming(p)):g.transformIncoming(p);if(p instanceof I.VSBuffer)return null;for(const w in p)if(Object.hasOwnProperty.call(p,w)){const l=b(p[w],g,h,f+1);l!==null&&(p[w]=l)}}return null}function S(p,g){const h=b(p,g,!1,0);return h===null?p:h}e.transformIncomingURIs=S;function P(p,g){const h=b(p,g,!0,0);return h===null?p:h}e.transformAndReviveIncomingURIs=P}),define(ce[31],le([0,1,52,36,269,5,48,88,16,6,22,11]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Promises=e.writeFileSync=e.configureFlushOnWrite=e.SymlinkSupport=e.whenDeleted=e.readdirSync=e.rimrafSync=e.RimRafMode=void 0;var g;(function(H){H[H.UNLINK=0]="UNLINK",H[H.MOVE=1]="MOVE"})(g||(e.RimRafMode=g={}));async function h(H,Y=g.UNLINK,B){if((0,k.isRootOrDriveLetter)(H))throw new Error("rimraf - will refuse to recursively delete root");return Y===g.UNLINK?w(H):f(H,B)}async function f(H,Y=(0,k.randomPath)((0,O.tmpdir)())){try{try{await I.promises.rename(H,Y)}catch(B){return B.code==="ENOENT"?void 0:w(H)}w(Y).catch(B=>{})}catch(B){if(B.code!=="ENOENT")throw B}}async function w(H){return(0,A.promisify)(I.rm)(H,{recursive:!0,force:!0,maxRetries:3})}function l(H){if((0,k.isRootOrDriveLetter)(H))throw new Error("rimraf - will refuse to recursively delete root");I.rmSync(H,{recursive:!0,force:!0,maxRetries:3})}e.rimrafSync=l;async function d(H,Y){return y(await(Y?c(H):(0,A.promisify)(I.readdir)(H)))}async function c(H){try{return await(0,A.promisify)(I.readdir)(H,{withFileTypes:!0})}catch(K){console.warn("[node.js fs] readdir with filetypes failed with error: ",K)}const Y=[],B=await d(H);for(const K of B){let x=!1,q=!1,j=!1;try{const Z=await e.Promises.lstat((0,b.join)(H,K));x=Z.isFile(),q=Z.isDirectory(),j=Z.isSymbolicLink()}catch(Z){console.warn("[node.js fs] unexpected error from lstat after readdir: ",Z)}Y.push({name:K,isFile:()=>x,isDirectory:()=>q,isSymbolicLink:()=>j})}return Y}function m(H){return y(I.readdirSync(H))}e.readdirSync=m;function y(H){return H.map(Y=>typeof Y=="string"?S.isMacintosh?(0,D.normalizeNFC)(Y):Y:(Y.name=S.isMacintosh?(0,D.normalizeNFC)(Y.name):Y.name,Y))}async function T(H){const Y=await d(H),B=[];for(const K of Y)await o.existsDirectory((0,b.join)(H,K))&&B.push(K);return B}function t(H,Y=1e3){return new Promise(B=>{let K=!1;const x=setInterval(()=>{K||(K=!0,I.access(H,q=>{K=!1,q&&(clearInterval(x),B(void 0))}))},Y)})}e.whenDeleted=t;var o;(function(H){async function Y(x){let q;try{if(q=await e.Promises.lstat(x),!q.isSymbolicLink())return{stat:q}}catch{}try{return{stat:await e.Promises.stat(x),symbolicLink:q?.isSymbolicLink()?{dangling:!1}:void 0}}catch(j){if(j.code==="ENOENT"&&q)return{stat:q,symbolicLink:{dangling:!0}};if(S.isWindows&&j.code==="EACCES")try{return{stat:await e.Promises.stat(await e.Promises.readlink(x)),symbolicLink:{dangling:!1}}}catch(Z){if(Z.code==="ENOENT"&&q)return{stat:q,symbolicLink:{dangling:!0}};throw Z}throw j}}H.stat=Y;async function B(x){try{const{stat:q,symbolicLink:j}=await H.stat(x);return q.isFile()&&j?.dangling!==!0}catch{}return!1}H.existsFile=B;async function K(x){try{const{stat:q,symbolicLink:j}=await H.stat(x);return q.isDirectory()&&j?.dangling!==!0}catch{}return!1}H.existsDirectory=K})(o||(e.SymlinkSupport=o={}));const n=new _.ResourceQueue;function s(H,Y,B){return n.queueFor(p.URI.file(H),P.extUriBiasedIgnorePathCase).queue(()=>{const K=v(B);return new Promise((x,q)=>a(H,Y,K,j=>j?q(j):x()))})}let i=!0;function r(H){i=H}e.configureFlushOnWrite=r;function a(H,Y,B,K){if(!i)return I.writeFile(H,Y,{mode:B.mode,flag:B.flag},K);I.open(H,B.flag,B.mode,(x,q)=>{if(x)return K(x);I.writeFile(q,Y,j=>{if(j)return I.close(q,()=>K(j));I.fdatasync(q,Z=>(Z&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",Z),r(!1)),I.close(q,oe=>K(oe))))})})}function E(H,Y,B){const K=v(B);if(!i)return I.writeFileSync(H,Y,{mode:K.mode,flag:K.flag});const x=I.openSync(H,K.flag,K.mode);try{I.writeFileSync(x,Y);try{I.fdatasyncSync(x)}catch(q){console.warn("[node.js fs] fdatasyncSync is now disabled for this session because it failed: ",q),r(!1)}}finally{I.closeSync(x)}}e.writeFileSync=E;function v(H){return H?{mode:typeof H.mode=="number"?H.mode:438,flag:typeof H.flag=="string"?H.flag:"w"}:{mode:438,flag:"w"}}async function u(H,Y,B=6e4){if(H!==Y)try{S.isWindows&&typeof B=="number"?await C(H,Y,Date.now(),B):await(0,A.promisify)(I.rename)(H,Y)}catch(K){if(H.toLowerCase()!==Y.toLowerCase()&&K.code==="EXDEV"||H.endsWith("."))await U(H,Y,{preserveSymlinks:!1}),await h(H,g.MOVE);else throw K}}async function C(H,Y,B,K,x=0){try{return await(0,A.promisify)(I.rename)(H,Y)}catch(q){if(q.code!=="EACCES"&&q.code!=="EPERM"&&q.code!=="EBUSY")throw q;if(Date.now()-B>=K)throw console.error(`[node.js fs] rename failed after ${x} retries with error: ${q}`),q;if(x===0){let j=!1;try{const{stat:Z}=await o.stat(Y);Z.isFile()||(j=!0)}catch{}if(j)throw q}return await(0,_.timeout)(Math.min(100,x*10)),C(H,Y,B,K,x+1)}}async function U(H,Y,B){return M(H,Y,{root:{source:H,target:Y},options:B,handledSourcePaths:new Set})}const F=511;async function M(H,Y,B){if(B.handledSourcePaths.has(H))return;B.handledSourcePaths.add(H);const{stat:K,symbolicLink:x}=await o.stat(H);if(x){if(B.options.preserveSymlinks)try{return await J(H,Y,B)}catch(q){console.warn("[node.js fs] copy of symlink failed: ",q)}if(x.dangling)return}return K.isDirectory()?z(H,Y,K.mode&F,B):V(H,Y,K.mode&F)}async function z(H,Y,B,K){await e.Promises.mkdir(Y,{recursive:!0,mode:B});const x=await d(H);for(const q of x)await M((0,b.join)(H,q),(0,b.join)(Y,q),K)}async function V(H,Y,B){await e.Promises.copyFile(H,Y),await e.Promises.chmod(Y,B)}async function J(H,Y,B){let K=await e.Promises.readlink(H);(0,k.isEqualOrParent)(K,B.root.source,!S.isLinux)&&(K=(0,b.join)(B.root.target,K.substr(B.root.source.length+1))),await e.Promises.symlink(K,Y)}e.Promises=new class{get access(){return(0,A.promisify)(I.access)}get stat(){return(0,A.promisify)(I.stat)}get lstat(){return(0,A.promisify)(I.lstat)}get utimes(){return(0,A.promisify)(I.utimes)}get read(){return(H,Y,B,K,x)=>new Promise((q,j)=>{I.read(H,Y,B,K,x,(Z,oe,ue)=>Z?j(Z):q({bytesRead:oe,buffer:ue}))})}get readFile(){return(0,A.promisify)(I.readFile)}get write(){return(H,Y,B,K,x)=>new Promise((q,j)=>{I.write(H,Y,B,K,x,(Z,oe,ue)=>Z?j(Z):q({bytesWritten:oe,buffer:ue}))})}get appendFile(){return(0,A.promisify)(I.appendFile)}get fdatasync(){return(0,A.promisify)(I.fdatasync)}get truncate(){return(0,A.promisify)(I.truncate)}get copyFile(){return(0,A.promisify)(I.copyFile)}get open(){return(0,A.promisify)(I.open)}get close(){return(0,A.promisify)(I.close)}get symlink(){return(0,A.promisify)(I.symlink)}get readlink(){return(0,A.promisify)(I.readlink)}get chmod(){return(0,A.promisify)(I.chmod)}get mkdir(){return(0,A.promisify)(I.mkdir)}get unlink(){return(0,A.promisify)(I.unlink)}get rmdir(){return(0,A.promisify)(I.rmdir)}get realpath(){return(0,A.promisify)(I.realpath)}async exists(H){try{return await e.Promises.access(H),!0}catch{return!1}}get readdir(){return d}get readDirsInDir(){return T}get writeFile(){return s}get rm(){return h}get rename(){return u}get copy(){return U}}}),define(ce[144],le([0,1,52,16,6,28,31]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.realpathSync=e.realpath=e.realcase=e.realcaseSync=void 0;function D(g){if(A.isLinux)return g;const h=(0,O.dirname)(g);if(g===h)return g;const f=((0,O.basename)(g)||g).toLowerCase();try{const l=(0,k.readdirSync)(h).filter(d=>d.toLowerCase()===f);if(l.length===1){const d=D(h);if(d)return(0,O.join)(d,l[0])}else if(l.length>1){const d=l.indexOf(f);if(d>=0){const c=D(h);if(c)return(0,O.join)(c,l[d])}}}catch{}return null}e.realcaseSync=D;async function b(g){if(A.isLinux)return g;const h=(0,O.dirname)(g);if(g===h)return g;const f=((0,O.basename)(g)||g).toLowerCase();try{const l=(await k.Promises.readdir(h)).filter(d=>d.toLowerCase()===f);if(l.length===1){const d=await b(h);if(d)return(0,O.join)(d,l[0])}else if(l.length>1){const d=l.indexOf(f);if(d>=0){const c=await b(h);if(c)return(0,O.join)(c,l[d])}}}catch{}return null}e.realcase=b;async function S(g){try{return await k.Promises.realpath(g)}catch{const f=p(g);return await k.Promises.access(f,I.constants.R_OK),f}}e.realpath=S;function P(g){try{return I.realpathSync(g)}catch{const f=p(g);return I.accessSync(f,I.constants.R_OK),f}}e.realpathSync=P;function p(g){return(0,_.rtrim)((0,O.normalize)(g),O.sep)}}),define(ce[145],le([0,1,16,6,37,92,12,31]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.win32=e.createQueuedSender=e.getWindowsShell=e.TerminateResponseCode=e.Source=void 0,Object.defineProperty(e,"Source",{enumerable:!0,get:function(){return _.Source}}),Object.defineProperty(e,"TerminateResponseCode",{enumerable:!0,get:function(){return _.TerminateResponseCode}});function b(p=A.env){return p.comspec||"cmd.exe"}e.getWindowsShell=b;function S(p){let g=[],h=!1;const f=function(w){if(h){g.push(w);return}(!p.send(w,d=>{if(d&&console.error(d),h=!1,g.length>0){const c=g.slice(0);g=[],c.forEach(m=>f(m))}})||O.isWindows)&&(h=!0)};return{send:f}}e.createQueuedSender=S;var P;(function(p){async function g(h,f,w){if(I.isAbsolute(h))return h;if(f===void 0&&(f=A.cwd()),I.dirname(h)!=="."||(w===void 0&&k.isString(A.env.PATH)&&(w=A.env.PATH.split(I.delimiter)),w===void 0||w.length===0))return I.join(f,h);async function d(c){if(await D.Promises.exists(c)){let m;try{m=await D.Promises.stat(c)}catch(y){y.message.startsWith("EACCES")&&(m=await D.Promises.lstat(c))}return m?!m.isDirectory():!1}return!1}for(const c of w){let m;if(I.isAbsolute(c)?m=I.join(c,h):m=I.join(f,c,h),await d(m))return m;let y=m+".com";if(await d(y)||(y=m+".exe",await d(y)))return y}return I.join(f,h)}p.findExecutable=g})(P||(e.win32=P={}))}),define(ce[146],le([0,1,63,26]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.listProcesses=void 0;function A(k){return new Promise((D,b)=>{let S;const P=new Map;function p(h,f,w,l,d){const c=P.get(f);if(h===k||c){const m={name:g(w),cmd:w,pid:h,ppid:f,load:l,mem:d};P.set(h,m),h===k&&(S=m),c&&(c.children||(c.children=[]),c.children.push(m),c.children.length>1&&(c.children=c.children.sort((y,T)=>y.pid-T.pid)))}}function g(h){const f=/--utility-sub-type=network/i,w=/--ms-enable-electron-run-as-node/i,l=/--crashes-directory/i,d=/\\pipe\\winpty-control/i,c=/conhost\.exe.+--headless/i,m=/--type=([a-zA-Z-]+)/;if(l.exec(h))return"electron-crash-reporter";if(d.exec(h))return"winpty-agent";if(c.exec(h))return"conpty-agent";let y=m.exec(h);if(y&&y.length===2)return y[1]==="renderer"?"window":y[1]==="utility"?f.exec(h)?"utility-network-service":"utility-process":y[1]==="extensionHost"?"extension-host":y[1];const T=/[a-zA-Z-]+\.js/g;let t="";do y=T.exec(h),y&&(t+=y+" ");while(y);return t&&h.indexOf("node ")<0&&h.indexOf("node.exe")<0?`electron-nodejs (${t})`:w.exec(h)?`electron-nodejs (${h})`:h}if(process.platform==="win32"){const h=f=>f.indexOf("\\\\?\\")===0||f.indexOf("\\??\\")===0?f.substring(4):f.indexOf('"\\\\?\\')===0||f.indexOf('"\\??\\')===0?'"'+f.substring(5):f;new Promise((f,w)=>{te(["@vscode/windows-process-tree"],f,w)}).then(f=>{f.getProcessList(k,w=>{if(!w){b(new Error(`Root process ${k} not found`));return}f.getProcessCpuUsage(w,l=>{const d=new Map;l.forEach(c=>{const m=h(c.commandLine||"");d.set(c.pid,{name:g(m),cmd:m,pid:c.pid,ppid:c.ppid,load:c.cpu||0,mem:c.memory||0})}),S=d.get(k),S?(d.forEach(c=>{const m=d.get(c.ppid);m&&(m.children||(m.children=[]),m.children.push(c))}),d.forEach(c=>{c.children&&(c.children=c.children.sort((m,y)=>m.pid-y.pid))}),D(S)):b(new Error(`Root process ${k} not found`))})},f.ProcessDataFlag.CommandLine|f.ProcessDataFlag.Memory)})}else{let h=function(){let f=[S];const w=[];for(;f.length;){const d=f.shift();d&&(w.push(d.pid),d.children&&(f=f.concat(d.children)))}let l=JSON.stringify(O.FileAccess.asFileUri("vs/base/node/cpuUsage.sh").fsPath);l+=" "+w.join(" "),(0,I.exec)(l,{},(d,c,m)=>{if(d||m)b(d||new Error(m.toString()));else{const y=c.toString().split(`
`);for(let T=0;T<w.length;T++){const t=P.get(w[T]);t.load=parseFloat(y[T])}if(!S){b(new Error(`Root process ${k} not found`));return}D(S)}})};(0,I.exec)("which ps",{},(f,w,l)=>{if(f||l)if(process.platform!=="linux")b(f||new Error(l.toString()));else{const d=JSON.stringify(O.FileAccess.asFileUri("vs/base/node/ps.sh").fsPath);(0,I.exec)(d,{},(c,m,y)=>{c||y?b(c||new Error(y.toString())):(_(m,p),h())})}else{const d=w.toString().trim(),c="-ax -o pid=,ppid=,pcpu=,pmem=,command=";(0,I.exec)(`${d} ${c}`,{maxBuffer:1e3*1024,env:{LC_NUMERIC:"en_US.UTF-8"}},(m,y,T)=>{m||T&&!T.includes("screen size is bogus")?b(m||new Error(T.toString())):(_(y,p),process.platform==="linux"?h():S?D(S):b(new Error(`Root process ${k} not found`)))})}})}})}e.listProcesses=A;function _(k,D){const b=/^\s*([0-9]+)\s+([0-9]+)\s+([0-9]+\.[0-9]+)\s+([0-9]+\.[0-9]+)\s+(.+)$/,S=k.toString().split(`
`);for(const P of S){const p=b.exec(P.trim());p&&p.length===6&&D(parseInt(p[1]),parseInt(p[2]),p[5],parseFloat(p[3]),parseFloat(p[4]))}}});var Ee=this&&this.__decorate||function(te,e,I,O){var A=arguments.length,_=A<3?e:O===null?O=Object.getOwnPropertyDescriptor(e,I):O,k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(te,e,I,O);else for(var D=te.length-1;D>=0;D--)(k=te[D])&&(_=(A<3?k(_):A>3?k(e,I,_):k(e,I))||_);return A>3&&_&&Object.defineProperty(e,I,_),_};define(ce[44],le([0,1,20,5,14,25,83,8,3,2,62,28,12]),function(te,e,I,O,A,_,k,D,b,S,P,p,g){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IPCLogger=e.ProxyChannel=e.StaticRouter=e.getNextTickChannel=e.getDelayedChannel=e.IPCClient=e.IPCServer=e.ChannelClient=e.RequestInitiator=e.ChannelServer=e.deserialize=e.serialize=e.BufferWriter=e.BufferReader=void 0;var h;(function(x){x[x.Promise=100]="Promise",x[x.PromiseCancel=101]="PromiseCancel",x[x.EventListen=102]="EventListen",x[x.EventDispose=103]="EventDispose"})(h||(h={}));function f(x){switch(x){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}var w;(function(x){x[x.Initialize=200]="Initialize",x[x.PromiseSuccess=201]="PromiseSuccess",x[x.PromiseError=202]="PromiseError",x[x.PromiseErrorObj=203]="PromiseErrorObj",x[x.EventFire=204]="EventFire"})(w||(w={}));function l(x){switch(x){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}var d;(function(x){x[x.Uninitialized=0]="Uninitialized",x[x.Idle=1]="Idle"})(d||(d={}));function c(x){let q=0;for(let j=0;;j+=7){const Z=x.read(1);if(q|=(Z.buffer[0]&127)<<j,!(Z.buffer[0]&128))return q}}const m=n(0);function y(x,q){if(q===0){x.write(m);return}let j=0;for(let oe=q;oe!==0;oe=oe>>>7)j++;const Z=A.VSBuffer.alloc(j);for(let oe=0;q!==0;oe++)Z.buffer[oe]=q&127,q=q>>>7,q>0&&(Z.buffer[oe]|=128);x.write(Z)}class T{constructor(q){this.buffer=q,this.pos=0}read(q){const j=this.buffer.slice(this.pos,this.pos+q);return this.pos+=j.byteLength,j}}e.BufferReader=T;class t{constructor(){this.buffers=[]}get buffer(){return A.VSBuffer.concat(this.buffers)}write(q){this.buffers.push(q)}}e.BufferWriter=t;var o;(function(x){x[x.Undefined=0]="Undefined",x[x.String=1]="String",x[x.Buffer=2]="Buffer",x[x.VSBuffer=3]="VSBuffer",x[x.Array=4]="Array",x[x.Object=5]="Object",x[x.Int=6]="Int"})(o||(o={}));function n(x){const q=A.VSBuffer.alloc(1);return q.writeUInt8(x,0),q}const s={Undefined:n(o.Undefined),String:n(o.String),Buffer:n(o.Buffer),VSBuffer:n(o.VSBuffer),Array:n(o.Array),Object:n(o.Object),Uint:n(o.Int)},i=typeof Buffer<"u";function r(x,q){if(typeof q>"u")x.write(s.Undefined);else if(typeof q=="string"){const j=A.VSBuffer.fromString(q);x.write(s.String),y(x,j.byteLength),x.write(j)}else if(i&&Buffer.isBuffer(q)){const j=A.VSBuffer.wrap(q);x.write(s.Buffer),y(x,j.byteLength),x.write(j)}else if(q instanceof A.VSBuffer)x.write(s.VSBuffer),y(x,q.byteLength),x.write(q);else if(Array.isArray(q)){x.write(s.Array),y(x,q.length);for(const j of q)r(x,j)}else if(typeof q=="number"&&(q|0)===q)x.write(s.Uint),y(x,q);else{const j=A.VSBuffer.fromString(JSON.stringify(q));x.write(s.Object),y(x,j.byteLength),x.write(j)}}e.serialize=r;function a(x){switch(x.read(1).readUInt8(0)){case o.Undefined:return;case o.String:return x.read(c(x)).toString();case o.Buffer:return x.read(c(x)).buffer;case o.VSBuffer:return x.read(c(x));case o.Array:{const j=c(x),Z=[];for(let oe=0;oe<j;oe++)Z.push(a(x));return Z}case o.Object:return JSON.parse(x.read(c(x)).toString());case o.Int:return c(x)}}e.deserialize=a;class E{constructor(q,j,Z=null,oe=1e3){this.protocol=q,this.ctx=j,this.logger=Z,this.timeoutDelay=oe,this.channels=new Map,this.activeRequests=new Map,this.pendingRequests=new Map,this.protocolListener=this.protocol.onMessage(ue=>this.onRawMessage(ue)),this.sendResponse({type:200})}registerChannel(q,j){this.channels.set(q,j),setTimeout(()=>this.flushPendingRequests(q),0)}sendResponse(q){switch(q.type){case 200:{const j=this.send([q.type]);this.logger?.logOutgoing(j,0,1,l(q.type));return}case 201:case 202:case 204:case 203:{const j=this.send([q.type,q.id],q.data);this.logger?.logOutgoing(j,q.id,1,l(q.type),q.data);return}}}send(q,j=void 0){const Z=new t;return r(Z,q),r(Z,j),this.sendBuffer(Z.buffer)}sendBuffer(q){try{return this.protocol.send(q),q.byteLength}catch{return 0}}onRawMessage(q){const j=new T(q),Z=a(j),oe=a(j),ue=Z[0];switch(ue){case 100:return this.logger?.logIncoming(q.byteLength,Z[1],1,`${f(ue)}: ${Z[2]}.${Z[3]}`,oe),this.onPromise({type:ue,id:Z[1],channelName:Z[2],name:Z[3],arg:oe});case 102:return this.logger?.logIncoming(q.byteLength,Z[1],1,`${f(ue)}: ${Z[2]}.${Z[3]}`,oe),this.onEventListen({type:ue,id:Z[1],channelName:Z[2],name:Z[3],arg:oe});case 101:return this.logger?.logIncoming(q.byteLength,Z[1],1,`${f(ue)}`),this.disposeActiveRequest({type:ue,id:Z[1]});case 103:return this.logger?.logIncoming(q.byteLength,Z[1],1,`${f(ue)}`),this.disposeActiveRequest({type:ue,id:Z[1]})}}onPromise(q){const j=this.channels.get(q.channelName);if(!j){this.collectPendingRequest(q);return}const Z=new _.CancellationTokenSource;let oe;try{oe=j.call(this.ctx,q.name,q.arg,Z.token)}catch($){oe=Promise.reject($)}const ue=q.id;oe.then($=>{this.sendResponse({id:ue,data:$,type:201}),this.activeRequests.delete(q.id)},$=>{$ instanceof Error?this.sendResponse({id:ue,data:{message:$.message,name:$.name,stack:$.stack?$.stack.split?$.stack.split(`
`):$.stack:void 0},type:202}):this.sendResponse({id:ue,data:$,type:203}),this.activeRequests.delete(q.id)});const ae=(0,S.toDisposable)(()=>Z.cancel());this.activeRequests.set(q.id,ae)}onEventListen(q){const j=this.channels.get(q.channelName);if(!j){this.collectPendingRequest(q);return}const Z=q.id,ue=j.listen(this.ctx,q.name,q.arg)(ae=>this.sendResponse({id:Z,data:ae,type:204}));this.activeRequests.set(q.id,ue)}disposeActiveRequest(q){const j=this.activeRequests.get(q.id);j&&(j.dispose(),this.activeRequests.delete(q.id))}collectPendingRequest(q){let j=this.pendingRequests.get(q.channelName);j||(j=[],this.pendingRequests.set(q.channelName,j));const Z=setTimeout(()=>{console.error(`Unknown channel: ${q.channelName}`),q.type===100&&this.sendResponse({id:q.id,data:{name:"Unknown channel",message:`Channel name '${q.channelName}' timed out after ${this.timeoutDelay}ms`,stack:void 0},type:202})},this.timeoutDelay);j.push({request:q,timeoutTimer:Z})}flushPendingRequests(q){const j=this.pendingRequests.get(q);if(j){for(const Z of j)switch(clearTimeout(Z.timeoutTimer),Z.request.type){case 100:this.onPromise(Z.request);break;case 102:this.onEventListen(Z.request);break}this.pendingRequests.delete(q)}}dispose(){this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),(0,S.dispose)(this.activeRequests.values()),this.activeRequests.clear()}}e.ChannelServer=E;var v;(function(x){x[x.LocalSide=0]="LocalSide",x[x.OtherSide=1]="OtherSide"})(v||(e.RequestInitiator=v={}));class u{constructor(q,j=null){this.protocol=q,this.isDisposed=!1,this.state=d.Uninitialized,this.activeRequests=new Set,this.handlers=new Map,this.lastRequestId=0,this._onDidInitialize=new b.Emitter,this.onDidInitialize=this._onDidInitialize.event,this.protocolListener=this.protocol.onMessage(Z=>this.onBuffer(Z)),this.logger=j}getChannel(q){const j=this;return{call(Z,oe,ue){return j.isDisposed?Promise.reject(new D.CancellationError):j.requestPromise(q,Z,oe,ue)},listen(Z,oe){return j.isDisposed?b.Event.None:j.requestEvent(q,Z,oe)}}}requestPromise(q,j,Z,oe=_.CancellationToken.None){const ue=this.lastRequestId++,$={id:ue,type:100,channelName:q,name:j,arg:Z};if(oe.isCancellationRequested)return Promise.reject(new D.CancellationError);let R;return new Promise((N,W)=>{if(oe.isCancellationRequested)return W(new D.CancellationError);const X=()=>{const ee=ie=>{switch(ie.type){case 201:this.handlers.delete(ue),N(ie.data);break;case 202:{this.handlers.delete(ue);const de=new Error(ie.data.message);de.stack=Array.isArray(ie.data.stack)?ie.data.stack.join(`
`):ie.data.stack,de.name=ie.data.name,W(de);break}case 203:this.handlers.delete(ue),W(ie.data);break}};this.handlers.set(ue,ee),this.sendRequest($)};let ne=null;this.state===d.Idle?X():(ne=(0,O.createCancelablePromise)(ee=>this.whenInitialized()),ne.then(()=>{ne=null,X()}));const re=()=>{ne?(ne.cancel(),ne=null):this.sendRequest({id:ue,type:101}),W(new D.CancellationError)},Q=oe.onCancellationRequested(re);R=(0,S.combinedDisposable)((0,S.toDisposable)(re),Q),this.activeRequests.add(R)}).finally(()=>{this.activeRequests.delete(R)})}requestEvent(q,j,Z){const oe=this.lastRequestId++,ae={id:oe,type:102,channelName:q,name:j,arg:Z};let $=null;const R=new b.Emitter({onWillAddFirstListener:()=>{$=(0,O.createCancelablePromise)(N=>this.whenInitialized()),$.then(()=>{$=null,this.activeRequests.add(R),this.sendRequest(ae)})},onDidRemoveLastListener:()=>{$?($.cancel(),$=null):(this.activeRequests.delete(R),this.sendRequest({id:oe,type:103}))}}),L=N=>R.fire(N.data);return this.handlers.set(oe,L),R.event}sendRequest(q){switch(q.type){case 100:case 102:{const j=this.send([q.type,q.id,q.channelName,q.name],q.arg);this.logger?.logOutgoing(j,q.id,0,`${f(q.type)}: ${q.channelName}.${q.name}`,q.arg);return}case 101:case 103:{const j=this.send([q.type,q.id]);this.logger?.logOutgoing(j,q.id,0,f(q.type));return}}}send(q,j=void 0){const Z=new t;return r(Z,q),r(Z,j),this.sendBuffer(Z.buffer)}sendBuffer(q){try{return this.protocol.send(q),q.byteLength}catch{return 0}}onBuffer(q){const j=new T(q),Z=a(j),oe=a(j),ue=Z[0];switch(ue){case 200:return this.logger?.logIncoming(q.byteLength,0,0,l(ue)),this.onResponse({type:Z[0]});case 201:case 202:case 204:case 203:return this.logger?.logIncoming(q.byteLength,Z[1],0,l(ue),oe),this.onResponse({type:Z[0],id:Z[1],data:oe})}}onResponse(q){if(q.type===200){this.state=d.Idle,this._onDidInitialize.fire();return}this.handlers.get(q.id)?.(q)}get onDidInitializePromise(){return b.Event.toPromise(this.onDidInitialize)}whenInitialized(){return this.state===d.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.isDisposed=!0,this.protocolListener&&(this.protocolListener.dispose(),this.protocolListener=null),(0,S.dispose)(this.activeRequests.values()),this.activeRequests.clear()}}e.ChannelClient=u,Ee([k.memoize],u.prototype,"onDidInitializePromise",null);class C{get connections(){const q=[];return this._connections.forEach(j=>q.push(j)),q}constructor(q){this.channels=new Map,this._connections=new Set,this._onDidAddConnection=new b.Emitter,this.onDidAddConnection=this._onDidAddConnection.event,this._onDidRemoveConnection=new b.Emitter,this.onDidRemoveConnection=this._onDidRemoveConnection.event,q(({protocol:j,onDidClientDisconnect:Z})=>{b.Event.once(j.onMessage)(ue=>{const ae=new T(ue),$=a(ae),R=new E(j,$),L=new u(j);this.channels.forEach((W,X)=>R.registerChannel(X,W));const N={channelServer:R,channelClient:L,ctx:$};this._connections.add(N),this._onDidAddConnection.fire(N),Z(()=>{R.dispose(),L.dispose(),this._connections.delete(N),this._onDidRemoveConnection.fire(N)})})})}getChannel(q,j){const Z=this;return{call(oe,ue,ae){let $;if((0,g.isFunction)(j)){const L=(0,I.getRandomElement)(Z.connections.filter(j));$=L?Promise.resolve(L):b.Event.toPromise(b.Event.filter(Z.onDidAddConnection,j))}else $=j.routeCall(Z,oe,ue);const R=$.then(L=>L.channelClient.getChannel(q));return F(R).call(oe,ue,ae)},listen(oe,ue){if((0,g.isFunction)(j))return Z.getMulticastEvent(q,j,oe,ue);const ae=j.routeEvent(Z,oe,ue).then($=>$.channelClient.getChannel(q));return F(ae).listen(oe,ue)}}}getMulticastEvent(q,j,Z,oe){const ue=this;let ae=new S.DisposableStore;const $=new b.Emitter({onWillAddFirstListener:()=>{ae=new S.DisposableStore;const R=new b.EventMultiplexer,L=new Map,N=X=>{const re=X.channelClient.getChannel(q).listen(Z,oe),Q=R.add(re);L.set(X,Q)},W=X=>{const ne=L.get(X);ne&&(ne.dispose(),L.delete(X))};ue.connections.filter(j).forEach(N),b.Event.filter(ue.onDidAddConnection,j)(N,void 0,ae),ue.onDidRemoveConnection(W,void 0,ae),R.event($.fire,$,ae),ae.add(R)},onDidRemoveLastListener:()=>{ae.dispose()}});return $.event}registerChannel(q,j){this.channels.set(q,j),this._connections.forEach(Z=>{Z.channelServer.registerChannel(q,j)})}dispose(){this.channels.clear(),this._connections.clear(),this._onDidAddConnection.dispose(),this._onDidRemoveConnection.dispose()}}e.IPCServer=C;class U{constructor(q,j,Z=null){const oe=new t;r(oe,j),q.send(oe.buffer),this.channelClient=new u(q,Z),this.channelServer=new E(q,j,Z)}getChannel(q){return this.channelClient.getChannel(q)}registerChannel(q,j){this.channelServer.registerChannel(q,j)}dispose(){this.channelClient.dispose(),this.channelServer.dispose()}}e.IPCClient=U;function F(x){return{call(q,j,Z){return x.then(oe=>oe.call(q,j,Z))},listen(q,j){const Z=new b.Relay;return x.then(oe=>Z.input=oe.listen(q,j)),Z.event}}}e.getDelayedChannel=F;function M(x){let q=!1;return{call(j,Z,oe){return q?x.call(j,Z,oe):(0,O.timeout)(0).then(()=>q=!0).then(()=>x.call(j,Z,oe))},listen(j,Z){if(q)return x.listen(j,Z);const oe=new b.Relay;return(0,O.timeout)(0).then(()=>q=!0).then(()=>oe.input=x.listen(j,Z)),oe.event}}}e.getNextTickChannel=M;class z{constructor(q){this.fn=q}routeCall(q){return this.route(q)}routeEvent(q){return this.route(q)}async route(q){for(const j of q.connections)if(await Promise.resolve(this.fn(j.ctx)))return Promise.resolve(j);return await b.Event.toPromise(q.onDidAddConnection),await this.route(q)}}e.StaticRouter=z;var V;(function(x){function q(ue,ae){const $=ue,R=ae&&ae.disableMarshalling,L=new Map;for(const N in $)Z(N)&&L.set(N,b.Event.buffer($[N],!0));return new class{listen(N,W,X){const ne=L.get(W);if(ne)return ne;if(oe(W)){const re=$[W];if(typeof re=="function")return re.call($,X)}throw new D.ErrorNoTelemetry(`Event not found: ${W}`)}call(N,W,X){const ne=$[W];if(typeof ne=="function"){if(!R&&Array.isArray(X))for(let re=0;re<X.length;re++)X[re]=(0,P.revive)(X[re]);return ne.apply($,X)}throw new D.ErrorNoTelemetry(`Method not found: ${W}`)}}}x.fromService=q;function j(ue,ae){const $=ae&&ae.disableMarshalling;return new Proxy({},{get(R,L){if(typeof L=="string")return ae?.properties?.has(L)?ae.properties.get(L):oe(L)?function(N){return ue.listen(L,N)}:Z(L)?ue.listen(L):async function(...N){let W;ae&&!(0,g.isUndefinedOrNull)(ae.context)?W=[ae.context,...N]:W=N;const X=await ue.call(L,W);return $?X:(0,P.revive)(X)};throw new D.ErrorNoTelemetry(`Property not found: ${String(L)}`)}})}x.toService=j;function Z(ue){return ue[0]==="o"&&ue[1]==="n"&&p.isUpperAsciiLetter(ue.charCodeAt(2))}function oe(ue){return/^onDynamic/.test(ue)&&p.isUpperAsciiLetter(ue.charCodeAt(9))}})(V||(e.ProxyChannel=V={}));const J=[["#2977B1","#FC802D","#34A13A","#D3282F","#9366BA"],["#8B564C","#E177C0","#7F7F7F","#BBBE3D","#2EBECD"]];function H(x){if(Array.isArray(x))return x;if(x&&typeof x=="object"&&typeof x.toString=="function"){const q=x.toString();if(q!=="[object Object]")return q}return x}function Y(x){return Array.isArray(x)?x.map(H):H(x)}function B(x,q,j,Z,oe,ue,ae){ae=Y(ae);const $=J[oe],R=$[Z%$.length];let L=[`%c[${x}]%c[${String(q).padStart(7," ")}]%c[len: ${String(j).padStart(5," ")}]%c${String(Z).padStart(5," ")} - ${ue}`,"color: darkgreen","color: grey","color: grey",`color: ${R}`];/\($/.test(ue)?(L=L.concat(ae),L.push(")")):L.push(ae),console.log.apply(console,L)}class K{constructor(q,j){this._outgoingPrefix=q,this._incomingPrefix=j,this._totalIncoming=0,this._totalOutgoing=0}logOutgoing(q,j,Z,oe,ue){this._totalOutgoing+=q,B(this._outgoingPrefix,this._totalOutgoing,q,j,Z,oe,ue)}logIncoming(q,j,Z,oe,ue){this._totalIncoming+=q,B(this._incomingPrefix,this._totalIncoming,q,j,Z,oe,ue)}}e.IPCLogger=K}),define(ce[64],le([0,1,14,3,2,44]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PersistentProtocol=e.BufferedEmitter=e.Client=e.Protocol=e.ProtocolConstants=e.ChunkStream=e.SocketCloseEventType=e.SocketDiagnostics=e.SocketDiagnosticsEventType=void 0;var k;(function(s){s.Created="created",s.Read="read",s.Write="write",s.Open="open",s.Error="error",s.Close="close",s.BrowserWebSocketBlobReceived="browserWebSocketBlobReceived",s.NodeEndReceived="nodeEndReceived",s.NodeEndSent="nodeEndSent",s.NodeDrainBegin="nodeDrainBegin",s.NodeDrainEnd="nodeDrainEnd",s.zlibInflateError="zlibInflateError",s.zlibInflateData="zlibInflateData",s.zlibInflateInitialWrite="zlibInflateInitialWrite",s.zlibInflateInitialFlushFired="zlibInflateInitialFlushFired",s.zlibInflateWrite="zlibInflateWrite",s.zlibInflateFlushFired="zlibInflateFlushFired",s.zlibDeflateError="zlibDeflateError",s.zlibDeflateData="zlibDeflateData",s.zlibDeflateWrite="zlibDeflateWrite",s.zlibDeflateFlushFired="zlibDeflateFlushFired",s.WebSocketNodeSocketWrite="webSocketNodeSocketWrite",s.WebSocketNodeSocketPeekedHeader="webSocketNodeSocketPeekedHeader",s.WebSocketNodeSocketReadHeader="webSocketNodeSocketReadHeader",s.WebSocketNodeSocketReadData="webSocketNodeSocketReadData",s.WebSocketNodeSocketUnmaskedData="webSocketNodeSocketUnmaskedData",s.WebSocketNodeSocketDrainBegin="webSocketNodeSocketDrainBegin",s.WebSocketNodeSocketDrainEnd="webSocketNodeSocketDrainEnd",s.ProtocolHeaderRead="protocolHeaderRead",s.ProtocolMessageRead="protocolMessageRead",s.ProtocolHeaderWrite="protocolHeaderWrite",s.ProtocolMessageWrite="protocolMessageWrite",s.ProtocolWrite="protocolWrite"})(k||(e.SocketDiagnosticsEventType=k={}));var D;(function(s){s.enableDiagnostics=!1,s.records=[];const i=new WeakMap;let r=0;function a(v,u){if(!i.has(v)){const C=String(++r);i.set(v,C)}return i.get(v)}function E(v,u,C,U){if(!s.enableDiagnostics)return;const F=a(v,u);if(U instanceof I.VSBuffer||U instanceof Uint8Array||U instanceof ArrayBuffer||ArrayBuffer.isView(U)){const M=I.VSBuffer.alloc(U.byteLength);M.set(U),s.records.push({timestamp:Date.now(),id:F,label:u,type:C,buff:M})}else s.records.push({timestamp:Date.now(),id:F,label:u,type:C,data:U})}s.traceSocketEvent=E})(D||(e.SocketDiagnostics=D={}));var b;(function(s){s[s.NodeSocketCloseEvent=0]="NodeSocketCloseEvent",s[s.WebSocketCloseEvent=1]="WebSocketCloseEvent"})(b||(e.SocketCloseEventType=b={}));let S=null;function P(){return S||(S=I.VSBuffer.alloc(0)),S}class p{get byteLength(){return this._totalLength}constructor(){this._chunks=[],this._totalLength=0}acceptChunk(i){this._chunks.push(i),this._totalLength+=i.byteLength}read(i){return this._read(i,!0)}peek(i){return this._read(i,!1)}_read(i,r){if(i===0)return P();if(i>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===i){const u=this._chunks[0];return r&&(this._chunks.shift(),this._totalLength-=i),u}if(this._chunks[0].byteLength>i){const u=this._chunks[0].slice(0,i);return r&&(this._chunks[0]=this._chunks[0].slice(i),this._totalLength-=i),u}const a=I.VSBuffer.alloc(i);let E=0,v=0;for(;i>0;){const u=this._chunks[v];if(u.byteLength>i){const C=u.slice(0,i);a.set(C,E),E+=i,r&&(this._chunks[v]=u.slice(i),this._totalLength-=i),i-=i}else a.set(u,E),E+=u.byteLength,r?(this._chunks.shift(),this._totalLength-=u.byteLength):v++,i-=u.byteLength}return a}}e.ChunkStream=p;var g;(function(s){s[s.None=0]="None",s[s.Regular=1]="Regular",s[s.Control=2]="Control",s[s.Ack=3]="Ack",s[s.Disconnect=5]="Disconnect",s[s.ReplayRequest=6]="ReplayRequest",s[s.Pause=7]="Pause",s[s.Resume=8]="Resume",s[s.KeepAlive=9]="KeepAlive"})(g||(g={}));function h(s){switch(s){case 0:return"None";case 1:return"Regular";case 2:return"Control";case 3:return"Ack";case 5:return"Disconnect";case 6:return"ReplayRequest";case 7:return"PauseWriting";case 8:return"ResumeWriting";case 9:return"KeepAlive"}}var f;(function(s){s[s.HeaderLength=13]="HeaderLength",s[s.AcknowledgeTime=2e3]="AcknowledgeTime",s[s.TimeoutTime=2e4]="TimeoutTime",s[s.ReconnectionGraceTime=108e5]="ReconnectionGraceTime",s[s.ReconnectionShortGraceTime=3e5]="ReconnectionShortGraceTime",s[s.KeepAliveSendTime=5e3]="KeepAliveSendTime"})(f||(e.ProtocolConstants=f={}));class w{constructor(i,r,a,E){this.type=i,this.id=r,this.ack=a,this.data=E,this.writtenTime=0}get size(){return this.data.byteLength}}class l extends A.Disposable{constructor(i){super(),this._onMessage=this._register(new O.Emitter),this.onMessage=this._onMessage.event,this._state={readHead:!0,readLen:13,messageType:0,id:0,ack:0},this._socket=i,this._isDisposed=!1,this._incomingData=new p,this._register(this._socket.onData(r=>this.acceptChunk(r))),this.lastReadTime=Date.now()}acceptChunk(i){if(!(!i||i.byteLength===0))for(this.lastReadTime=Date.now(),this._incomingData.acceptChunk(i);this._incomingData.byteLength>=this._state.readLen;){const r=this._incomingData.read(this._state.readLen);if(this._state.readHead)this._state.readHead=!1,this._state.readLen=r.readUInt32BE(9),this._state.messageType=r.readUInt8(0),this._state.id=r.readUInt32BE(1),this._state.ack=r.readUInt32BE(5),this._socket.traceSocketEvent("protocolHeaderRead",{messageType:h(this._state.messageType),id:this._state.id,ack:this._state.ack,messageSize:this._state.readLen});else{const a=this._state.messageType,E=this._state.id,v=this._state.ack;if(this._state.readHead=!0,this._state.readLen=13,this._state.messageType=0,this._state.id=0,this._state.ack=0,this._socket.traceSocketEvent("protocolMessageRead",r),this._onMessage.fire(new w(a,E,v,r)),this._isDisposed)break}}}readEntireBuffer(){return this._incomingData.read(this._incomingData.byteLength)}dispose(){this._isDisposed=!0,super.dispose()}}class d{constructor(i){this._writeNowTimeout=null,this._isDisposed=!1,this._isPaused=!1,this._socket=i,this._data=[],this._totalLength=0,this.lastWriteTime=0}dispose(){try{this.flush()}catch{}this._isDisposed=!0}drain(){return this.flush(),this._socket.drain()}flush(){this._writeNow()}pause(){this._isPaused=!0}resume(){this._isPaused=!1,this._scheduleWriting()}write(i){if(this._isDisposed)return;i.writtenTime=Date.now(),this.lastWriteTime=Date.now();const r=I.VSBuffer.alloc(13);r.writeUInt8(i.type,0),r.writeUInt32BE(i.id,1),r.writeUInt32BE(i.ack,5),r.writeUInt32BE(i.data.byteLength,9),this._socket.traceSocketEvent("protocolHeaderWrite",{messageType:h(i.type),id:i.id,ack:i.ack,messageSize:i.data.byteLength}),this._socket.traceSocketEvent("protocolMessageWrite",i.data),this._writeSoon(r,i.data)}_bufferAdd(i,r){const a=this._totalLength===0;return this._data.push(i,r),this._totalLength+=i.byteLength+r.byteLength,a}_bufferTake(){const i=I.VSBuffer.concat(this._data,this._totalLength);return this._data.length=0,this._totalLength=0,i}_writeSoon(i,r){this._bufferAdd(i,r)&&this._scheduleWriting()}_scheduleWriting(){this._writeNowTimeout||(this._writeNowTimeout=setTimeout(()=>{this._writeNowTimeout=null,this._writeNow()}))}_writeNow(){if(this._totalLength===0||this._isPaused)return;const i=this._bufferTake();this._socket.traceSocketEvent("protocolWrite",{byteLength:i.byteLength}),this._socket.write(i)}}class c extends A.Disposable{constructor(i){super(),this._onMessage=new O.Emitter,this.onMessage=this._onMessage.event,this._onDidDispose=new O.Emitter,this.onDidDispose=this._onDidDispose.event,this._socket=i,this._socketWriter=this._register(new d(this._socket)),this._socketReader=this._register(new l(this._socket)),this._register(this._socketReader.onMessage(r=>{r.type===1&&this._onMessage.fire(r.data)})),this._register(this._socket.onClose(()=>this._onDidDispose.fire()))}drain(){return this._socketWriter.drain()}getSocket(){return this._socket}sendDisconnect(){}send(i){this._socketWriter.write(new w(1,0,0,i))}}e.Protocol=c;class m extends _.IPCClient{static fromSocket(i,r){return new m(new c(i),r)}get onDidDispose(){return this.protocol.onDidDispose}constructor(i,r,a=null){super(i,r,a),this.protocol=i}dispose(){super.dispose();const i=this.protocol.getSocket();this.protocol.sendDisconnect(),this.protocol.dispose(),i.end()}}e.Client=m;class y{constructor(){this._hasListeners=!1,this._isDeliveringMessages=!1,this._bufferedMessages=[],this._emitter=new O.Emitter({onWillAddFirstListener:()=>{this._hasListeners=!0,queueMicrotask(()=>this._deliverMessages())},onDidRemoveLastListener:()=>{this._hasListeners=!1}}),this.event=this._emitter.event}_deliverMessages(){if(!this._isDeliveringMessages){for(this._isDeliveringMessages=!0;this._hasListeners&&this._bufferedMessages.length>0;)this._emitter.fire(this._bufferedMessages.shift());this._isDeliveringMessages=!1}}fire(i){this._hasListeners?this._bufferedMessages.length>0?this._bufferedMessages.push(i):this._emitter.fire(i):this._bufferedMessages.push(i)}flushBuffer(){this._bufferedMessages=[]}}e.BufferedEmitter=y;class T{constructor(i){this.data=i,this.next=null}}class t{constructor(){this._first=null,this._last=null}length(){let i=0,r=this._first;for(;r;)r=r.next,i++;return i}peek(){return this._first?this._first.data:null}toArray(){const i=[];let r=0,a=this._first;for(;a;)i[r++]=a.data,a=a.next;return i}pop(){if(this._first){if(this._first===this._last){this._first=null,this._last=null;return}this._first=this._first.next}}push(i){const r=new T(i);if(!this._first){this._first=r,this._last=r;return}this._last.next=r,this._last=r}}class o{static{this._HISTORY_LENGTH=10}static{this._INSTANCE=null}static getInstance(){return o._INSTANCE||(o._INSTANCE=new o),o._INSTANCE}constructor(){this.lastRuns=[];const i=Date.now();for(let r=0;r<o._HISTORY_LENGTH;r++)this.lastRuns[r]=i-1e3*r;setInterval(()=>{for(let r=o._HISTORY_LENGTH;r>=1;r--)this.lastRuns[r]=this.lastRuns[r-1];this.lastRuns[0]=Date.now()},1e3)}load(){const i=Date.now(),r=(1+o._HISTORY_LENGTH)*1e3;let a=0;for(let E=0;E<o._HISTORY_LENGTH;E++)i-this.lastRuns[E]<=r&&a++;return 1-a/o._HISTORY_LENGTH}hasHighLoad(){return this.load()>=.5}}class n{get unacknowledgedCount(){return this._outgoingMsgId-this._outgoingAckId}constructor(i){this._onControlMessage=new y,this.onControlMessage=this._onControlMessage.event,this._onMessage=new y,this.onMessage=this._onMessage.event,this._onDidDispose=new y,this.onDidDispose=this._onDidDispose.event,this._onSocketClose=new y,this.onSocketClose=this._onSocketClose.event,this._onSocketTimeout=new y,this.onSocketTimeout=this._onSocketTimeout.event,this._loadEstimator=i.loadEstimator??o.getInstance(),this._shouldSendKeepAlive=i.sendKeepAlive??!0,this._isReconnecting=!1,this._outgoingUnackMsg=new t,this._outgoingMsgId=0,this._outgoingAckId=0,this._outgoingAckTimeout=null,this._incomingMsgId=0,this._incomingAckId=0,this._incomingMsgLastTime=0,this._incomingAckTimeout=null,this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socketDisposables=new A.DisposableStore,this._socket=i.socket,this._socketWriter=this._socketDisposables.add(new d(this._socket)),this._socketReader=this._socketDisposables.add(new l(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(r=>this._receiveMessage(r))),this._socketDisposables.add(this._socket.onClose(r=>this._onSocketClose.fire(r))),i.initialChunk&&this._socketReader.acceptChunk(i.initialChunk),this._shouldSendKeepAlive?this._keepAliveInterval=setInterval(()=>{this._sendKeepAlive()},5e3):this._keepAliveInterval=null}dispose(){this._outgoingAckTimeout&&(clearTimeout(this._outgoingAckTimeout),this._outgoingAckTimeout=null),this._incomingAckTimeout&&(clearTimeout(this._incomingAckTimeout),this._incomingAckTimeout=null),this._keepAliveInterval&&(clearInterval(this._keepAliveInterval),this._keepAliveInterval=null),this._socketDisposables.dispose()}drain(){return this._socketWriter.drain()}sendDisconnect(){const i=new w(5,0,0,P());this._socketWriter.write(i),this._socketWriter.flush()}sendPause(){const i=new w(7,0,0,P());this._socketWriter.write(i)}sendResume(){const i=new w(8,0,0,P());this._socketWriter.write(i)}pauseSocketWriting(){this._socketWriter.pause()}getSocket(){return this._socket}getMillisSinceLastIncomingData(){return Date.now()-this._socketReader.lastReadTime}beginAcceptReconnection(i,r){this._isReconnecting=!0,this._socketDisposables.dispose(),this._socketDisposables=new A.DisposableStore,this._onControlMessage.flushBuffer(),this._onSocketClose.flushBuffer(),this._onSocketTimeout.flushBuffer(),this._socket.dispose(),this._lastReplayRequestTime=0,this._lastSocketTimeoutTime=Date.now(),this._socket=i,this._socketWriter=this._socketDisposables.add(new d(this._socket)),this._socketReader=this._socketDisposables.add(new l(this._socket)),this._socketDisposables.add(this._socketReader.onMessage(a=>this._receiveMessage(a))),this._socketDisposables.add(this._socket.onClose(a=>this._onSocketClose.fire(a))),this._socketReader.acceptChunk(r)}endAcceptReconnection(){this._isReconnecting=!1,this._incomingAckId=this._incomingMsgId;const i=new w(3,0,this._incomingAckId,P());this._socketWriter.write(i);const r=this._outgoingUnackMsg.toArray();for(let a=0,E=r.length;a<E;a++)this._socketWriter.write(r[a]);this._recvAckCheck()}acceptDisconnect(){this._onDidDispose.fire()}_receiveMessage(i){if(i.ack>this._outgoingAckId){this._outgoingAckId=i.ack;do{const r=this._outgoingUnackMsg.peek();if(r&&r.id<=i.ack)this._outgoingUnackMsg.pop();else break}while(!0)}switch(i.type){case 0:break;case 1:{if(i.id>this._incomingMsgId)if(i.id!==this._incomingMsgId+1){const r=Date.now();r-this._lastReplayRequestTime>1e4&&(this._lastReplayRequestTime=r,this._socketWriter.write(new w(6,0,0,P())))}else this._incomingMsgId=i.id,this._incomingMsgLastTime=Date.now(),this._sendAckCheck(),this._onMessage.fire(i.data);break}case 2:{this._onControlMessage.fire(i.data);break}case 3:break;case 5:{this._onDidDispose.fire();break}case 6:{const r=this._outgoingUnackMsg.toArray();for(let a=0,E=r.length;a<E;a++)this._socketWriter.write(r[a]);this._recvAckCheck();break}case 7:{this._socketWriter.pause();break}case 8:{this._socketWriter.resume();break}case 9:break}}readEntireBuffer(){return this._socketReader.readEntireBuffer()}flush(){this._socketWriter.flush()}send(i){const r=++this._outgoingMsgId;this._incomingAckId=this._incomingMsgId;const a=new w(1,r,this._incomingAckId,i);this._outgoingUnackMsg.push(a),this._isReconnecting||(this._socketWriter.write(a),this._recvAckCheck())}sendControl(i){const r=new w(2,0,0,i);this._socketWriter.write(r)}_sendAckCheck(){if(this._incomingMsgId<=this._incomingAckId||this._incomingAckTimeout)return;const i=Date.now()-this._incomingMsgLastTime;if(i>=2e3){this._sendAck();return}this._incomingAckTimeout=setTimeout(()=>{this._incomingAckTimeout=null,this._sendAckCheck()},2e3-i+5)}_recvAckCheck(){if(this._outgoingMsgId<=this._outgoingAckId||this._outgoingAckTimeout||this._isReconnecting)return;const i=this._outgoingUnackMsg.peek(),r=Date.now()-i.writtenTime,a=Date.now()-this._socketReader.lastReadTime,E=Date.now()-this._lastSocketTimeoutTime;if(r>=2e4&&a>=2e4&&E>=2e4&&!this._loadEstimator.hasHighLoad()){this._lastSocketTimeoutTime=Date.now(),this._onSocketTimeout.fire({unacknowledgedMsgCount:this._outgoingUnackMsg.length(),timeSinceOldestUnacknowledgedMsg:r,timeSinceLastReceivedSomeData:a});return}const v=Math.max(2e4-r,2e4-a,2e4-E,500);this._outgoingAckTimeout=setTimeout(()=>{this._outgoingAckTimeout=null,this._recvAckCheck()},v)}_sendAck(){if(this._incomingMsgId<=this._incomingAckId)return;this._incomingAckId=this._incomingMsgId;const i=new w(3,0,this._incomingAckId,P());this._socketWriter.write(i)}_sendKeepAlive(){this._incomingAckId=this._incomingMsgId;const i=new w(9,0,this._incomingAckId,P());this._socketWriter.write(i)}}e.PersistentProtocol=n}),define(ce[95],le([0,1,63,5,14,25,142,8,3,2,30,145,92,44]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Client=e.Server=void 0;class f extends h.ChannelServer{constructor(d){super({send:c=>{try{process.send?.(c.buffer.toString("base64"))}catch{}},onMessage:b.Event.fromNodeEventEmitter(process,"message",c=>A.VSBuffer.wrap(Buffer.from(c,"base64")))},d),process.once("disconnect",()=>this.dispose())}}e.Server=f;class w{constructor(d,c){this.modulePath=d,this.options=c,this.activeRequests=new Set,this.channels=new Map,this._onDidProcessExit=new b.Emitter,this.onDidProcessExit=this._onDidProcessExit.event;const m=c&&c.timeout?c.timeout:6e4;this.disposeDelayer=new O.Delayer(m),this.child=null,this._client=null}getChannel(d){const c=this;return{call(m,y,T){return c.requestPromise(d,m,y,T)},listen(m,y){return c.requestEvent(d,m,y)}}}requestPromise(d,c,m,y=_.CancellationToken.None){if(!this.disposeDelayer)return Promise.reject(new Error("disposed"));if(y.isCancellationRequested)return Promise.reject(D.canceled());this.disposeDelayer.cancel();const T=this.getCachedChannel(d),t=(0,O.createCancelablePromise)(s=>T.call(c,m,s)),o=y.onCancellationRequested(()=>t.cancel()),n=(0,S.toDisposable)(()=>t.cancel());return this.activeRequests.add(n),t.finally(()=>{o.dispose(),this.activeRequests.delete(n),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}),t}requestEvent(d,c,m){if(!this.disposeDelayer)return b.Event.None;this.disposeDelayer.cancel();let y;const T=new b.Emitter({onWillAddFirstListener:()=>{y=this.getCachedChannel(d).listen(c,m)(T.fire,T),this.activeRequests.add(y)},onDidRemoveLastListener:()=>{this.activeRequests.delete(y),y.dispose(),this.activeRequests.size===0&&this.disposeDelayer&&this.disposeDelayer.trigger(()=>this.disposeClient())}});return T.event}get client(){if(!this._client){const d=this.options&&this.options.args?this.options.args:[],c=Object.create(null);c.env={...(0,P.deepClone)(process.env),VSCODE_PARENT_PID:String(process.pid)},this.options&&this.options.env&&(c.env={...c.env,...this.options.env}),this.options&&this.options.freshExecArgv&&(c.execArgv=[]),this.options&&typeof this.options.debug=="number"&&(c.execArgv=["--nolazy","--inspect="+this.options.debug]),this.options&&typeof this.options.debugBrk=="number"&&(c.execArgv=["--nolazy","--inspect-brk="+this.options.debugBrk]),c.execArgv===void 0&&(c.execArgv=process.execArgv.filter(i=>!/^--inspect(-brk)?=/.test(i)).filter(i=>!i.startsWith("--vscode-"))),(0,g.removeDangerousEnvVariables)(c.env),this.child=(0,I.fork)(this.modulePath,d,c);const m=new b.Emitter;b.Event.fromNodeEventEmitter(this.child,"message",i=>i)(i=>{if((0,k.isRemoteConsoleLog)(i)){(0,k.log)(i,`IPC Library: ${this.options.serverName}`);return}m.fire(A.VSBuffer.wrap(Buffer.from(i,"base64")))});const T=this.options.useQueue?(0,p.createQueuedSender)(this.child):this.child,t=i=>this.child&&this.child.connected&&T.send(i.buffer.toString("base64")),o=m.event,n={send:t,onMessage:o};this._client=new h.ChannelClient(n);const s=()=>this.disposeClient();process.once("exit",s),this.child.on("error",i=>console.warn('IPC "'+this.options.serverName+'" errored with '+i)),this.child.on("exit",(i,r)=>{process.removeListener("exit",s),this.activeRequests.forEach(a=>(0,S.dispose)(a)),this.activeRequests.clear(),i!==0&&r!=="SIGTERM"&&console.warn('IPC "'+this.options.serverName+'" crashed with exit code '+i+" and signal "+r),this.disposeDelayer?.cancel(),this.disposeClient(),this._onDidProcessExit.fire({code:i,signal:r})})}return this._client}getCachedChannel(d){let c=this.channels.get(d);return c||(c=this.client.getChannel(d),this.channels.set(d,c)),c}disposeClient(){this._client&&(this.child&&(this.child.kill(),this.child=null),this._client=null,this.channels.clear())}dispose(){this._onDidProcessExit.dispose(),this.disposeDelayer?.cancel(),this.disposeDelayer=void 0,this.disposeClient(),this.activeRequests.clear()}}e.Client=w}),define(ce[147],le([0,1,134,14,44,3,12,20]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.once=e.Server=void 0;class b{constructor(g){this.port=g,this.onMessage=_.Event.fromNodeEventEmitter(this.port,"message",h=>O.VSBuffer.wrap(h.data)),g.start()}send(g){this.port.postMessage(g.buffer)}disconnect(){this.port.close()}}class S extends A.IPCServer{static getOnDidClientConnect(g){(0,k.assertType)((0,I.isUtilityProcess)(process),"Electron Utility Process");const h=new _.Emitter;return process.parentPort.on("message",f=>{if(g?.handledClientConnection(f))return;const w=(0,D.firstOrDefault)(f.ports);w&&h.fire(w)}),_.Event.map(h.event,f=>({protocol:new b(f),onDidClientDisconnect:_.Event.fromNodeEventEmitter(f,"close")}))}constructor(g){super(S.getOnDidClientConnect(g))}}e.Server=S;function P(p,g,h){const f=w=>{w.data===g&&(p.removeListener("message",f),h())};p.on("message",f)}e.once=P}),define(ce[65],le([0,1,5,3,2,62,12]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryStorageDatabase=e.Storage=e.StorageState=e.isStorageItemsChangeEvent=e.StorageHint=void 0;var D;(function(g){g[g.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",g[g.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(D||(e.StorageHint=D={}));function b(g){const h=g;return h?.changed instanceof Map||h?.deleted instanceof Set}e.isStorageItemsChangeEvent=b;var S;(function(g){g[g.None=0]="None",g[g.Initialized=1]="Initialized",g[g.Closed=2]="Closed"})(S||(e.StorageState=S={}));class P extends A.Disposable{static{this.DEFAULT_FLUSH_DELAY=100}constructor(h,f=Object.create(null)){super(),this.database=h,this.options=f,this._onDidChangeStorage=this._register(new O.PauseableEmitter),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=S.None,this.cache=new Map,this.flushDelayer=new I.ThrottledDelayer(P.DEFAULT_FLUSH_DELAY),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(h=>this.onDidChangeItemsExternal(h)))}onDidChangeItemsExternal(h){this._onDidChangeStorage.pause();try{h.changed?.forEach((f,w)=>this.acceptExternal(w,f)),h.deleted?.forEach(f=>this.acceptExternal(f,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(h,f){if(this.state===S.Closed)return;let w=!1;(0,k.isUndefinedOrNull)(f)?w=this.cache.delete(h):this.cache.get(h)!==f&&(this.cache.set(h,f),w=!0),w&&this._onDidChangeStorage.fire({key:h,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===S.None&&(this.state=S.Initialized,this.options.hint!==D.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(h,f){const w=this.cache.get(h);return(0,k.isUndefinedOrNull)(w)?f:w}getBoolean(h,f){const w=this.get(h);return(0,k.isUndefinedOrNull)(w)?f:w==="true"}getNumber(h,f){const w=this.get(h);return(0,k.isUndefinedOrNull)(w)?f:parseInt(w,10)}getObject(h,f){const w=this.get(h);return(0,k.isUndefinedOrNull)(w)?f:(0,_.parse)(w)}async set(h,f,w=!1){if(this.state===S.Closed)return;if((0,k.isUndefinedOrNull)(f))return this.delete(h,w);const l=(0,k.isObject)(f)||Array.isArray(f)?(0,_.stringify)(f):String(f);if(this.cache.get(h)!==l)return this.cache.set(h,l),this.pendingInserts.set(h,l),this.pendingDeletes.delete(h),this._onDidChangeStorage.fire({key:h,external:w}),this.doFlush()}async delete(h,f=!1){if(!(this.state===S.Closed||!this.cache.delete(h)))return this.pendingDeletes.has(h)||this.pendingDeletes.add(h),this.pendingInserts.delete(h),this._onDidChangeStorage.fire({key:h,external:f}),this.doFlush()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=S.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const h={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(h).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(h){if(this.hasPending)return this.doFlush(h)}async doFlush(h){return this.flushDelayer.trigger(()=>this.flushPending(),h)}async whenFlushed(){if(this.hasPending)return new Promise(h=>this.whenFlushedCallbacks.push(h))}isInMemory(){return this.options.hint===D.STORAGE_IN_MEMORY}dispose(){this.flushDelayer.dispose(),super.dispose()}}e.Storage=P;class p{constructor(){this.onDidChangeItemsExternal=O.Event.None,this.items=new Map}async getItems(){return this.items}async updateItems(h){h.insert?.forEach((f,w)=>this.items.set(w,f)),h.delete?.forEach(f=>this.items.delete(f))}async close(){}}e.InMemoryStorageDatabase=p}),define(ce[148],le([10,9]),function(te,e){return te.create("vs/base/node/zip",e)}),define(ce[149],le([10,9]),function(te,e){return te.create("vs/platform/configuration/common/configurationRegistry",e)}),define(ce[150],le([10,9]),function(te,e){return te.create("vs/platform/contextkey/common/contextkey",e)}),define(ce[151],le([10,9]),function(te,e){return te.create("vs/platform/contextkey/common/scanner",e)}),define(ce[152],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/common/abstractExtensionManagementService",e)}),define(ce[153],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/common/extensionManagement",e)}),define(ce[154],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/common/extensionNls",e)}),define(ce[155],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/common/extensionsScannerService",e)}),define(ce[156],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/node/extensionManagementService",e)}),define(ce[157],le([10,9]),function(te,e){return te.create("vs/platform/extensionManagement/node/extensionManagementUtil",e)}),define(ce[158],le([10,9]),function(te,e){return te.create("vs/platform/extensions/common/extensionValidator",e)}),define(ce[159],le([10,9]),function(te,e){return te.create("vs/platform/files/common/fileService",e)}),define(ce[160],le([10,9]),function(te,e){return te.create("vs/platform/files/common/files",e)}),define(ce[161],le([10,9]),function(te,e){return te.create("vs/platform/files/common/io",e)}),define(ce[162],le([10,9]),function(te,e){return te.create("vs/platform/files/node/diskFileSystemProvider",e)}),define(ce[163],le([10,9]),function(te,e){return te.create("vs/platform/languagePacks/common/languagePacks",e)}),define(ce[164],le([10,9]),function(te,e){return te.create("vs/platform/remoteTunnel/common/remoteTunnel",e)}),define(ce[165],le([10,9]),function(te,e){return te.create("vs/platform/remoteTunnel/node/remoteTunnelService",e)}),define(ce[166],le([10,9]),function(te,e){return te.create("vs/platform/request/common/request",e)}),define(ce[167],le([10,9]),function(te,e){return te.create("vs/platform/telemetry/common/telemetryLogAppender",e)}),define(ce[168],le([10,9]),function(te,e){return te.create("vs/platform/telemetry/common/telemetryService",e)}),define(ce[169],le([10,9]),function(te,e){return te.create("vs/platform/userDataProfile/common/userDataProfile",e)}),define(ce[170],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/abstractSynchronizer",e)}),define(ce[171],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/keybindingsSync",e)}),define(ce[172],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/settingsSync",e)}),define(ce[173],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/userDataAutoSyncService",e)}),define(ce[174],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/userDataSync",e)}),define(ce[175],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/userDataSyncLog",e)}),define(ce[176],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/userDataSyncMachines",e)}),define(ce[177],le([10,9]),function(te,e){return te.create("vs/platform/userDataSync/common/userDataSyncResourceProvider",e)}),define(ce[178],le([10,9]),function(te,e){return te.create("vs/platform/workspace/common/workspace",e)}),define(ce[179],le([0,1,8,151]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scanner=e.TokenType=void 0;var A;(function(S){S[S.LParen=0]="LParen",S[S.RParen=1]="RParen",S[S.Neg=2]="Neg",S[S.Eq=3]="Eq",S[S.NotEq=4]="NotEq",S[S.Lt=5]="Lt",S[S.LtEq=6]="LtEq",S[S.Gt=7]="Gt",S[S.GtEq=8]="GtEq",S[S.RegexOp=9]="RegexOp",S[S.RegexStr=10]="RegexStr",S[S.True=11]="True",S[S.False=12]="False",S[S.In=13]="In",S[S.Not=14]="Not",S[S.And=15]="And",S[S.Or=16]="Or",S[S.Str=17]="Str",S[S.QuotedStr=18]="QuotedStr",S[S.Error=19]="Error",S[S.EOF=20]="EOF"})(A||(e.TokenType=A={}));function _(...S){switch(S.length){case 1:return(0,O.localize)(0,null,S[0]);case 2:return(0,O.localize)(1,null,S[0],S[1]);case 3:return(0,O.localize)(2,null,S[0],S[1],S[2]);default:return}}const k=(0,O.localize)(3,null),D=(0,O.localize)(4,null);class b{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(P){switch(P.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return P.isTripleEq?"===":"==";case 4:return P.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return P.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return P.lexeme;case 18:return P.lexeme;case 19:return P.lexeme;case 20:return"EOF";default:throw(0,I.illegalState)(`unhandled token type: ${JSON.stringify(P)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set(["i","g","s","m","y","u"].map(P=>P.charCodeAt(0)))}static{this._keywords=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this._errors}reset(P){return this._input=P,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const p=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:p})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const p=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:p})}else this._match(126)?this._addToken(9):this._error(_("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(_("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(_("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(P){return this._isAtEnd()||this._input.charCodeAt(this._current)!==P?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(P){this._tokens.push({type:P,offset:this._start})}_error(P){const p=this._start,g=this._input.substring(this._start,this._current),h={type:19,offset:this._start,lexeme:g};this._errors.push({offset:p,lexeme:g,additionalInfo:P}),this._tokens.push(h)}_string(){this.stringRe.lastIndex=this._start;const P=this.stringRe.exec(this._input);if(P){this._current=this._start+P[0].length;const p=this._input.substring(this._start,this._current),g=b._keywords.get(p);g?this._addToken(g):this._tokens.push({type:17,lexeme:p,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(k);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let P=this._current,p=!1,g=!1;for(;;){if(P>=this._input.length){this._current=P,this._error(D);return}const f=this._input.charCodeAt(P);if(p)p=!1;else if(f===47&&!g){P++;break}else f===91?g=!0:f===92?p=!0:f===93&&(g=!1);P++}for(;P<this._input.length&&b._regexFlags.has(this._input.charCodeAt(P));)P++;this._current=P;const h=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:h,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}}e.Scanner=b}),define(ce[180],le([0,1,61,83,26,16,37,22,11]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseDebugParams=e.parseExtensionHostDebugPort=e.AbstractNativeEnvironmentService=e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX=void 0,e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX=/^([^.]+\..+):(.+)$/;class S{get appRoot(){return(0,_.dirname)(A.FileAccess.asFileUri("").fsPath)}get userHome(){return b.URI.file(this.paths.homeDir)}get userDataPath(){return this.paths.userDataDir}get appSettingsHome(){return b.URI.file((0,_.join)(this.userDataPath,"User"))}get tmpDir(){return b.URI.file(this.paths.tmpDir)}get cacheHome(){return b.URI.file(this.userDataPath)}get stateResource(){return(0,D.joinPath)(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:A.Schemas.vscodeUserData})}get userDataSyncHome(){return(0,D.joinPath)(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){const h=(0,I.toLocalISOString)(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=(0,_.join)(this.userDataPath,"logs",h)}return b.URI.file(this.args.logsPath)}get sync(){return this.args.sync}get machineSettingsResource(){return(0,D.joinPath)(b.URI.file((0,_.join)(this.userDataPath,"Machine")),"settings.json")}get workspaceStorageHome(){return(0,D.joinPath)(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return(0,D.joinPath)(this.appSettingsHome,"History")}get keyboardLayoutResource(){return(0,D.joinPath)(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){const h=k.env.VSCODE_PORTABLE;return h?b.URI.file((0,_.join)(h,"argv.json")):(0,D.joinPath)(this.userHome,this.productService.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return b.URI.file((0,_.join)(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){const h=this.args["builtin-extensions-dir"];return h?(0,_.resolve)(h):(0,_.normalize)((0,_.join)(A.FileAccess.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){const h=this.args["extensions-download-dir"];return h?b.URI.file((0,_.resolve)(h)):b.URI.file((0,_.join)(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){const h=this.args["extensions-dir"];if(h)return(0,_.resolve)(h);const f=k.env.ADS_EXTENSIONS||k.env.VSCODE_EXTENSIONS;if(f)return f;const w=k.env.VSCODE_PORTABLE;return w?(0,_.join)(w,"extensions"):(0,D.joinPath)(this.userHome,this.productService.dataFolderName,"extensions").fsPath}get extensionDevelopmentLocationURI(){const h=this.args.extensionDevelopmentPath;if(Array.isArray(h))return h.map(f=>/^[^:/?#]+?:\/\//.test(f)?b.URI.parse(f):b.URI.file((0,_.normalize)(f)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(h=>h==="ui"||h==="workspace"||h==="web"?h:"workspace")}get extensionTestsLocationURI(){const h=this.args.extensionTestsPath;if(h)return/^[^:/?#]+?:\/\//.test(h)?b.URI.parse(h):b.URI.file((0,_.normalize)(h))}get disableExtensions(){if(this.args["disable-extensions"])return!0;const h=this.args["disable-extension"];if(h){if(typeof h=="string")return[h];if(Array.isArray(h)&&h.length>0)return h}return!1}get debugExtensionHost(){return P(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!k.env.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(h=>!e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX.test(h))}get extensionLogLevel(){const h=[];for(const f of this.args.log||[]){const w=e.EXTENSION_IDENTIFIER_WITH_LOG_REGEX.exec(f);w&&w[1]&&w[2]&&h.push([w[1],w[2]])}return h.length?h:void 0}get serviceMachineIdResource(){return(0,D.joinPath)(b.URI.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get disableKeytar(){return!!this.args["disable-keytar"]}get policyFile(){if(this.args["__enable-file-policy"]){const h=k.env.VSCODE_PORTABLE;return h?b.URI.file((0,_.join)(h,"policy.json")):(0,D.joinPath)(this.userHome,this.productService.dataFolderName,"policy.json")}}get continueOn(){return this.args.continueOn}set continueOn(h){this.args.continueOn=h}get args(){return this._args}constructor(h,f,w){this._args=h,this.paths=f,this.productService=w,this.editSessionId=this.args.editSessionId}}e.AbstractNativeEnvironmentService=S,Ee([O.memoize],S.prototype,"appRoot",null),Ee([O.memoize],S.prototype,"userHome",null),Ee([O.memoize],S.prototype,"userDataPath",null),Ee([O.memoize],S.prototype,"appSettingsHome",null),Ee([O.memoize],S.prototype,"tmpDir",null),Ee([O.memoize],S.prototype,"cacheHome",null),Ee([O.memoize],S.prototype,"stateResource",null),Ee([O.memoize],S.prototype,"userRoamingDataHome",null),Ee([O.memoize],S.prototype,"userDataSyncHome",null),Ee([O.memoize],S.prototype,"sync",null),Ee([O.memoize],S.prototype,"machineSettingsResource",null),Ee([O.memoize],S.prototype,"workspaceStorageHome",null),Ee([O.memoize],S.prototype,"localHistoryHome",null),Ee([O.memoize],S.prototype,"keyboardLayoutResource",null),Ee([O.memoize],S.prototype,"argvResource",null),Ee([O.memoize],S.prototype,"isExtensionDevelopment",null),Ee([O.memoize],S.prototype,"untitledWorkspacesHome",null),Ee([O.memoize],S.prototype,"builtinExtensionsPath",null),Ee([O.memoize],S.prototype,"extensionsPath",null),Ee([O.memoize],S.prototype,"extensionDevelopmentLocationURI",null),Ee([O.memoize],S.prototype,"extensionDevelopmentKind",null),Ee([O.memoize],S.prototype,"extensionTestsLocationURI",null),Ee([O.memoize],S.prototype,"debugExtensionHost",null),Ee([O.memoize],S.prototype,"logLevel",null),Ee([O.memoize],S.prototype,"extensionLogLevel",null),Ee([O.memoize],S.prototype,"serviceMachineIdResource",null),Ee([O.memoize],S.prototype,"disableTelemetry",null),Ee([O.memoize],S.prototype,"disableWorkspaceTrust",null),Ee([O.memoize],S.prototype,"disableKeytar",null),Ee([O.memoize],S.prototype,"policyFile",null);function P(g,h){return p(g["inspect-extensions"],g["inspect-brk-extensions"],5870,h,g.debugId,g.extensionEnvironment)}e.parseExtensionHostDebugPort=P;function p(g,h,f,w,l,d){const m=Number(h||g)||(w?null:f),y=m?!!h:!1;let T;if(d)try{T=JSON.parse(d)}catch{}return{port:m,break:y,debugId:l,env:T}}e.parseDebugParams=p}),function(){"use strict";function te(e,I,O){function A(k,D){const b=_(k,D),S=[b];return e.isAbsolute(b)||S.unshift(O),e.resolve(...S)}function _(k,D){process.env.VSCODE_DEV&&(D="code-oss-dev");const b=process.env.VSCODE_PORTABLE;if(b)return e.join(b,"user-data");let S=process.env.VSCODE_APPDATA;if(S)return e.join(S,D);const P=k["user-data-dir"];if(P)return P;switch(process.platform){case"win32":if(S=process.env.APPDATA,!S){const p=process.env.USERPROFILE;if(typeof p!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");S=e.join(p,"AppData","Roaming")}break;case"darwin":S=e.join(I.homedir(),"Library","Application Support");break;case"linux":S=process.env.XDG_CONFIG_HOME||e.join(I.homedir(),".config");break;default:throw new Error("Platform not supported")}return e.join(S,"azuredatastudio")}return{getUserDataPath:A}}if(typeof define=="function")define(ce[181],le([270,36,37]),function(e,I,O){return te(e,I,O.cwd())});else if(typeof module=="object"&&typeof module.exports=="object"){const e=require("path"),I=require("os");module.exports=te(e,I,process.env.VSCODE_CWD||process.cwd())}else throw new Error("Unknown context")}(),define(ce[182],le([0,1,36,180,181]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseSharedProcessDebugPort=e.parsePtyHostDebugPort=e.NativeEnvironmentService=void 0;class _ extends O.AbstractNativeEnvironmentService{constructor(S,P){super(S,{homeDir:(0,I.homedir)(),tmpDir:(0,I.tmpdir)(),userDataDir:(0,A.getUserDataPath)(S,P.nameShort)},P)}}e.NativeEnvironmentService=_;function k(b,S){return(0,O.parseDebugParams)(b["inspect-ptyhost"],b["inspect-brk-ptyhost"],5877,S,b.extensionEnvironment)}e.parsePtyHostDebugPort=k;function D(b,S){return(0,O.parseDebugParams)(b["inspect-sharedprocess"],b["inspect-brk-sharedprocess"],5879,S,b.extensionEnvironment)}e.parseSharedProcessDebugPort=D}),define(ce[183],le([0,1,12,154]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.localizeManifest=void 0;function A(k,D,b){try{_(k,D,b)}catch(S){console.error(S?.message??S)}return k}e.localizeManifest=A;function _(k,D,b){const S=(P,p,g)=>{const h=P[p];if((0,I.isString)(h)){const f=h,w=f.length;if(w>1&&f[0]==="%"&&f[w-1]==="%"){const l=f.substr(1,w-2);let d=D[l];d===void 0&&b&&(d=b[l]);const c=typeof d=="string"?d:d?.message,m=b?.[l],y=typeof m=="string"?m:m?.message;if(!c){y||console.warn(`[${k.name}]: ${(0,O.localize)(0,null,l)}`);return}if(g&&(p==="title"||p==="category")&&y&&y!==c){const T={value:c,original:y};P[p]=T}else P[p]=c}}else if((0,I.isObject)(h))for(const f in h)h.hasOwnProperty(f)&&(f==="commands"?S(h,f,!0):S(h,f,g));else if(Array.isArray(h))for(let f=0;f<h.length;f++)S(h,f,g)};for(const P in k)k.hasOwnProperty(P)&&S(k,P)}}),define(ce[184],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionRecommendationNotificationServiceChannel=e.ExtensionRecommendationNotificationServiceChannelClient=void 0;class I{constructor(_){this.channel=_}get ignoredRecommendations(){throw new Error("not supported")}promptImportantExtensionsInstallNotification(_){return this.channel.call("promptImportantExtensionsInstallNotification",[_])}promptWorkspaceRecommendations(_){throw new Error("not supported")}hasToIgnoreRecommendationNotifications(){throw new Error("not supported")}}e.ExtensionRecommendationNotificationServiceChannelClient=I;class O{constructor(_){this.service=_}listen(_,k){throw new Error(`Event not found: ${k}`)}call(_,k,D){switch(k){case"promptImportantExtensionsInstallNotification":return this.service.promptImportantExtensionsInstallNotification(D[0])}throw new Error(`Call not found: ${k}`)}}e.ExtensionRecommendationNotificationServiceChannel=O}),define(ce[66],le([0,1,22,90,158,53,91]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isEngineValid=e.isValidExtensionVersion=e.validateExtensionManifest=e.isValidVersion=e.normalizeVersion=e.parseVersion=e.isValidVersionStr=void 0;const D=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,b=/^-(\d{4})(\d{2})(\d{2})$/;function S(c){return c=c.trim(),c==="*"||D.test(c)}e.isValidVersionStr=S;function P(c){if(!S(c))return null;if(c=c.trim(),c==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const m=c.match(D);return m?{hasCaret:m[1]==="^",hasGreaterEquals:m[1]===">=",majorBase:m[2]==="x"?0:parseInt(m[2],10),majorMustEqual:m[2]!=="x",minorBase:m[4]==="x"?0:parseInt(m[4],10),minorMustEqual:m[4]!=="x",patchBase:m[6]==="x"?0:parseInt(m[6],10),patchMustEqual:m[6]!=="x",preRelease:m[8]||null}:null}e.parseVersion=P;function p(c){if(!c)return null;const m=c.majorBase,y=c.majorMustEqual,T=c.minorBase;let t=c.minorMustEqual;const o=c.patchBase;let n=c.patchMustEqual;c.hasCaret&&(m===0||(t=!1),n=!1);let s=0;if(c.preRelease){const i=b.exec(c.preRelease);if(i){const[,r,a,E]=i;s=Date.UTC(Number(r),Number(a)-1,Number(E))}}return{majorBase:m,majorMustEqual:y,minorBase:T,minorMustEqual:t,patchBase:o,patchMustEqual:n,isMinimum:c.hasGreaterEquals,notBefore:s}}e.normalizeVersion=p;function g(c,m,y){let T;typeof c=="string"?T=p(P(c)):T=c;let t;m instanceof Date?t=m.getTime():typeof m=="string"&&(t=new Date(m).getTime());let o;if(typeof y=="string"?o=p(P(y)):o=y,!T||!o)return!1;const n=T.majorBase,s=T.minorBase,i=T.patchBase;let r=o.majorBase,a=o.minorBase,E=o.patchBase;const v=o.notBefore;let u=o.majorMustEqual,C=o.minorMustEqual,U=o.patchMustEqual;return o.isMinimum?n>r?!0:n<r?!1:s>a?!0:s<a||t&&t<v?!1:i>=E:(n===1&&r===0&&(!u||!C||!U)&&(r=1,a=0,E=0,u=!0,C=!1,U=!1),n<r?!1:n>r?!u:s<a?!1:s>a?!C:i<E?!1:i>E?!U:!(t&&t<v))}e.isValidVersion=g;function h(c,m,y,T,t,o){const n=[];if(typeof t.publisher<"u"&&typeof t.publisher!="string")return n.push([O.default.Error,A.localize(0,null)]),n;if(typeof t.name!="string")return n.push([O.default.Error,A.localize(1,null,"name")]),n;if(typeof t.version!="string")return n.push([O.default.Error,A.localize(2,null,"version")]),n;if(!t.engines)return n.push([O.default.Error,A.localize(3,null,"engines")]),n;if(typeof t.engines.vscode!="string")return n.push([O.default.Error,A.localize(4,null,"engines.vscode")]),n;if(typeof t.extensionDependencies<"u"&&!d(t.extensionDependencies))return n.push([O.default.Error,A.localize(5,null,"extensionDependencies")]),n;if(typeof t.activationEvents<"u"){if(!d(t.activationEvents))return n.push([O.default.Error,A.localize(6,null,"activationEvents")]),n;if(typeof t.main>"u"&&typeof t.browser>"u")return n.push([O.default.Error,A.localize(7,null,"activationEvents","main","browser")]),n}if(typeof t.extensionKind<"u"&&typeof t.main>"u"&&n.push([O.default.Warning,A.localize(8,null,"extensionKind")]),typeof t.main<"u"){if(typeof t.main!="string")return n.push([O.default.Error,A.localize(9,null,"main")]),n;{const r=(0,I.joinPath)(T,t.main);(0,I.isEqualOrParent)(r,T)||n.push([O.default.Warning,A.localize(10,null,r.path,T.path)])}}if(typeof t.browser<"u"){if(typeof t.browser!="string")return n.push([O.default.Error,A.localize(11,null,"browser")]),n;{const r=(0,I.joinPath)(T,t.browser);(0,I.isEqualOrParent)(r,T)||n.push([O.default.Warning,A.localize(12,null,r.path,T.path)])}}if(!_.valid(t.version))return n.push([O.default.Error,A.localize(13,null)]),n;const s=[];if(!f(c,m,y,t,o,s))for(const r of s)n.push([O.default.Error,r]);return n}e.validateExtensionManifest=h;function f(c,m,y,T,t,o){if(t||typeof T.main>"u"&&typeof T.browser>"u")return!0;const n=T.engines.azdata,s=T.engines.vscode,i=n?n==="*"||l(c,y,n,k.versionSyntax("engines.azdata",n),k.versionMismatch(c,n),o):!0,r=s?s==="*"||l(m,y,s,k.versionSyntax("engines.vscode",s),k.versionMismatchVsCode(c,s,m),o):!0;return i&&r}e.isValidExtensionVersion=f;function w(c,m,y){return c==="*"||l(m,y,c,"","")}e.isEngineValid=w;function l(c,m,y,T,t,o=[]){const n=p(P(y));return n?g(c,m,n)?!0:(o.push(t),!1):(o.push(T),!1)}function d(c){if(!Array.isArray(c))return!1;for(let m=0,y=c.length;m<y;m++)if(typeof c[m]!="string")return!1;return!0}}),define(ce[45],le([0,1,14,32]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getServiceMachineId=void 0;async function A(_,k,D){let b=D&&D.get("storage.serviceMachineId",-1)||null;if(b)return b;try{const P=(await k.readFile(_.serviceMachineIdResource)).value.toString();b=(0,O.isUUID)(P)?P:null}catch{b=null}if(!b){b=(0,O.generateUuid)();try{await k.writeFile(_.serviceMachineIdResource,I.VSBuffer.fromString(b))}catch{}}return D?.store("storage.serviceMachineId",b,-1,1),b}e.getServiceMachineId=A}),define(ce[67],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SyncDescriptor=void 0;class I{constructor(A,_=[],k=!1){this.ctor=A,this.staticArguments=_,this.supportsDelayedInstantiation=k}}e.SyncDescriptor=I}),define(ce[185],le([0,1,67]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingletonServiceDescriptors=e.registerSingleton=e.InstantiationType=void 0;const O=[];var A;(function(D){D[D.Eager=0]="Eager",D[D.Delayed=1]="Delayed"})(A||(e.InstantiationType=A={}));function _(D,b,S){b instanceof I.SyncDescriptor||(b=new I.SyncDescriptor(b,[],!!S)),O.push([D,b])}e.registerSingleton=_;function k(){return O}e.getSingletonServiceDescriptors=k}),define(ce[186],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=e.Node=void 0;class I{constructor(_,k){this.key=_,this.data=k,this.incoming=new Map,this.outgoing=new Map}}e.Node=I;class O{constructor(_){this._hashFn=_,this._nodes=new Map}roots(){const _=[];for(const k of this._nodes.values())k.outgoing.size===0&&_.push(k);return _}insertEdge(_,k){const D=this.lookupOrInsertNode(_),b=this.lookupOrInsertNode(k);D.outgoing.set(b.key,b),b.incoming.set(D.key,D)}removeNode(_){const k=this._hashFn(_);this._nodes.delete(k);for(const D of this._nodes.values())D.outgoing.delete(k),D.incoming.delete(k)}lookupOrInsertNode(_){const k=this._hashFn(_);let D=this._nodes.get(k);return D||(D=new I(k,_),this._nodes.set(k,D)),D}lookup(_){return this._nodes.get(this._hashFn(_))}isEmpty(){return this._nodes.size===0}toString(){const _=[];for(const[k,D]of this._nodes)_.push(`${k}
	(-> incoming)[${[...D.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...D.outgoing.keys()].join(",")}]
`);return _.join(`
`)}findCycleSlow(){for(const[_,k]of this._nodes){const D=new Set([_]),b=this._findCycle(k,D);if(b)return b}}_findCycle(_,k){for(const[D,b]of _.outgoing){if(k.has(D))return[...k,D].join(" -> ");k.add(D);const S=this._findCycle(b,k);if(S)return S;k.delete(D)}}}e.Graph=O}),define(ce[4],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.refineServiceDecorator=e.createDecorator=e.IInstantiationService=e._util=void 0;var I;(function(k){k.serviceIds=new Map,k.DI_TARGET="$di$target",k.DI_DEPENDENCIES="$di$dependencies";function D(b){return b[k.DI_DEPENDENCIES]||[]}k.getServiceDependencies=D})(I||(e._util=I={})),e.IInstantiationService=A("instantiationService");function O(k,D,b){D[I.DI_TARGET]===D?D[I.DI_DEPENDENCIES].push({id:k,index:b}):(D[I.DI_DEPENDENCIES]=[{id:k,index:b}],D[I.DI_TARGET]=D)}function A(k){if(I.serviceIds.has(k))return I.serviceIds.get(k);const D=function(b,S,P){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");O(D,b,P)};return D.toString=()=>k,I.serviceIds.set(k,D),D}e.createDecorator=A;function _(k){return k}e.refineServiceDecorator=_}),define(ce[187],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IChecksumService=void 0,e.IChecksumService=(0,I.createDecorator)("checksumService")}),define(ce[18],le([0,1,12,11,4]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLanguageTagSettingPlainKey=e.merge=e.getConfigurationValue=e.removeFromValueTree=e.addToValueTree=e.toValuesTree=e.isConfigured=e.ConfigurationTargetToString=e.ConfigurationTarget=e.isConfigurationUpdateOverrides=e.isConfigurationOverrides=e.IConfigurationService=void 0,e.IConfigurationService=(0,A.createDecorator)("configurationService");function _(d){return d&&typeof d=="object"&&(!d.overrideIdentifier||typeof d.overrideIdentifier=="string")&&(!d.resource||d.resource instanceof O.URI)}e.isConfigurationOverrides=_;function k(d){return d&&typeof d=="object"&&(!d.overrideIdentifiers||Array.isArray(d.overrideIdentifiers))&&!d.overrideIdentifier&&(!d.resource||d.resource instanceof O.URI)}e.isConfigurationUpdateOverrides=k;var D;(function(d){d[d.APPLICATION=1]="APPLICATION",d[d.USER=2]="USER",d[d.USER_LOCAL=3]="USER_LOCAL",d[d.USER_REMOTE=4]="USER_REMOTE",d[d.WORKSPACE=5]="WORKSPACE",d[d.WORKSPACE_FOLDER=6]="WORKSPACE_FOLDER",d[d.DEFAULT=7]="DEFAULT",d[d.MEMORY=8]="MEMORY"})(D||(e.ConfigurationTarget=D={}));function b(d){switch(d){case 1:return"APPLICATION";case 2:return"USER";case 3:return"USER_LOCAL";case 4:return"USER_REMOTE";case 5:return"WORKSPACE";case 6:return"WORKSPACE_FOLDER";case 7:return"DEFAULT";case 8:return"MEMORY"}}e.ConfigurationTargetToString=b;function S(d){return d.applicationValue!==void 0||d.userValue!==void 0||d.userLocalValue!==void 0||d.userRemoteValue!==void 0||d.workspaceValue!==void 0||d.workspaceFolderValue!==void 0}e.isConfigured=S;function P(d,c){const m=Object.create(null);for(const y in d)p(m,y,d[y],c);return m}e.toValuesTree=P;function p(d,c,m,y){const T=c.split("."),t=T.pop();let o=d;for(let n=0;n<T.length;n++){const s=T[n];let i=o[s];switch(typeof i){case"undefined":i=o[s]=Object.create(null);break;case"object":break;default:y(`Ignoring ${c} as ${T.slice(0,n+1).join(".")} is ${JSON.stringify(i)}`);return}o=i}if(typeof o=="object"&&o!==null)try{o[t]=m}catch{y(`Ignoring ${c} as ${T.join(".")} is ${JSON.stringify(o)}`)}else y(`Ignoring ${c} as ${T.join(".")} is ${JSON.stringify(o)}`)}e.addToValueTree=p;function g(d,c){const m=c.split(".");h(d,m)}e.removeFromValueTree=g;function h(d,c){const m=c.shift();if(c.length===0){delete d[m];return}if(Object.keys(d).indexOf(m)!==-1){const y=d[m];typeof y=="object"&&!Array.isArray(y)&&(h(y,c),Object.keys(y).length===0&&delete d[m])}}function f(d,c,m){function y(o,n){let s=o;for(const i of n){if(typeof s!="object"||s===null)return;s=s[i]}return s}const T=c.split("."),t=y(d,T);return typeof t>"u"?m:t}e.getConfigurationValue=f;function w(d,c,m){Object.keys(c).forEach(y=>{y!=="__proto__"&&(y in d?I.isObject(d[y])&&I.isObject(c[y])?w(d[y],c[y],m):m&&(d[y]=c[y]):d[y]=c[y])})}e.merge=w;function l(d){return d.replace(/[\[\]]/g,"")}e.getLanguageTagSettingPlainKey=l}),define(ce[96],le([0,1,6,28,179,4,150,8]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.implies=e.IContextKeyService=e.RawContextKey=e.ContextKeyOrExpr=e.ContextKeyAndExpr=e.ContextKeyNotRegexExpr=e.ContextKeyRegexExpr=e.ContextKeySmallerEqualsExpr=e.ContextKeySmallerExpr=e.ContextKeyGreaterEqualsExpr=e.ContextKeyGreaterExpr=e.ContextKeyNotExpr=e.ContextKeyNotEqualsExpr=e.ContextKeyNotInExpr=e.ContextKeyInExpr=e.ContextKeyEqualsExpr=e.ContextKeyDefinedExpr=e.ContextKeyTrueExpr=e.ContextKeyFalseExpr=e.expressionsAreEqualWithConstantSubstitution=e.validateWhenClauses=e.ContextKeyExpr=e.Parser=e.ContextKeyExprType=e.setConstant=void 0;const b=new Map;b.set("false",!1),b.set("true",!0),b.set("isMac",I.isMacintosh),b.set("isLinux",I.isLinux),b.set("isWindows",I.isWindows),b.set("isWeb",I.isWeb),b.set("isMacNative",I.isMacintosh&&!I.isWeb),b.set("isEdge",I.isEdge),b.set("isFirefox",I.isFirefox),b.set("isChrome",I.isChrome),b.set("isSafari",I.isSafari);function S($,R){if(b.get($)!==void 0)throw(0,D.illegalArgument)("contextkey.setConstant(k, v) invoked with already set constant `k`");b.set($,R)}e.setConstant=S;const P=Object.prototype.hasOwnProperty;var p;(function($){$[$.False=0]="False",$[$.True=1]="True",$[$.Defined=2]="Defined",$[$.Not=3]="Not",$[$.Equals=4]="Equals",$[$.NotEquals=5]="NotEquals",$[$.And=6]="And",$[$.Regex=7]="Regex",$[$.NotRegex=8]="NotRegex",$[$.Or=9]="Or",$[$.In=10]="In",$[$.NotIn=11]="NotIn",$[$.Greater=12]="Greater",$[$.GreaterEquals=13]="GreaterEquals",$[$.Smaller=14]="Smaller",$[$.SmallerEquals=15]="SmallerEquals"})(p||(e.ContextKeyExprType=p={}));const g={regexParsingWithErrorRecovery:!0},h=(0,k.localize)(0,null),f=(0,k.localize)(1,null),w=(0,k.localize)(2,null),l=(0,k.localize)(3,null),d=(0,k.localize)(4,null),c=(0,k.localize)(5,null),m=(0,k.localize)(6,null),y=(0,k.localize)(7,null);class T{static{this._parseError=new Error}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}constructor(R=g){this._config=R,this._scanner=new A.Scanner,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(R){if(R===""){this._parsingErrors.push({message:h,offset:0,lexeme:"",additionalInfo:f});return}this._tokens=this._scanner.reset(R).scan(),this._current=0,this._parsingErrors=[];try{const L=this._expr();if(!this._isAtEnd()){const N=this._peek(),W=N.type===17?c:void 0;throw this._parsingErrors.push({message:d,offset:N.offset,lexeme:A.Scanner.getLexeme(N),additionalInfo:W}),T._parseError}return L}catch(L){if(L!==T._parseError)throw L;return}}_expr(){return this._or()}_or(){const R=[this._and()];for(;this._matchOne(16);){const L=this._and();R.push(L)}return R.length===1?R[0]:t.or(...R)}_and(){const R=[this._term()];for(;this._matchOne(15);){const L=this._term();R.push(L)}return R.length===1?R[0]:t.and(...R)}_term(){if(this._matchOne(2)){const R=this._peek();switch(R.type){case 11:return this._advance(),i.INSTANCE;case 12:return this._advance(),r.INSTANCE;case 0:{this._advance();const L=this._expr();return this._consume(1,l),L?.negate()}case 17:return this._advance(),U.create(R.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",R)}}return this._primary()}_primary(){const R=this._peek();switch(R.type){case 11:return this._advance(),t.true();case 12:return this._advance(),t.false();case 0:{this._advance();const L=this._expr();return this._consume(1,l),L}case 17:{const L=R.lexeme;if(this._advance(),this._matchOne(9)){const W=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),W.type!==10)throw this._errExpectedButGot("REGEX",W);const X=W.lexeme,ne=X.lastIndexOf("/"),re=ne===X.length-1?void 0:this._removeFlagsGY(X.substring(ne+1));let Q;try{Q=new RegExp(X.substring(1,ne),re)}catch{throw this._errExpectedButGot("REGEX",W)}return H.create(L,Q)}switch(W.type){case 10:case 19:{const X=[W.lexeme];this._advance();let ne=this._peek(),re=0;for(let fe=0;fe<W.lexeme.length;fe++)W.lexeme.charCodeAt(fe)===40?re++:W.lexeme.charCodeAt(fe)===41&&re--;for(;!this._isAtEnd()&&ne.type!==15&&ne.type!==16;){switch(ne.type){case 0:re++;break;case 1:re--;break;case 10:case 18:for(let fe=0;fe<ne.lexeme.length;fe++)ne.lexeme.charCodeAt(fe)===40?re++:W.lexeme.charCodeAt(fe)===41&&re--}if(re<0)break;X.push(A.Scanner.getLexeme(ne)),this._advance(),ne=this._peek()}const Q=X.join(""),ee=Q.lastIndexOf("/"),ie=ee===Q.length-1?void 0:this._removeFlagsGY(Q.substring(ee+1));let de;try{de=new RegExp(Q.substring(1,ee),ie)}catch{throw this._errExpectedButGot("REGEX",W)}return t.regex(L,de)}case 18:{const X=W.lexeme;this._advance();let ne=null;if(!(0,O.isFalsyOrWhitespace)(X)){const re=X.indexOf("/"),Q=X.lastIndexOf("/");if(re!==Q&&re>=0){const ee=X.slice(re+1,Q),ie=X[Q+1]==="i"?"i":"";try{ne=new RegExp(ee,ie)}catch{throw this._errExpectedButGot("REGEX",W)}}}if(ne===null)throw this._errExpectedButGot("REGEX",W);return H.create(L,ne)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,w);const W=this._value();return t.notIn(L,W)}switch(this._peek().type){case 3:{this._advance();const W=this._value();if(this._previous().type===18)return t.equals(L,W);switch(W){case"true":return t.has(L);case"false":return t.not(L);default:return t.equals(L,W)}}case 4:{this._advance();const W=this._value();if(this._previous().type===18)return t.notEquals(L,W);switch(W){case"true":return t.not(L);case"false":return t.has(L);default:return t.notEquals(L,W)}}case 5:return this._advance(),V.create(L,this._value());case 6:return this._advance(),J.create(L,this._value());case 7:return this._advance(),M.create(L,this._value());case 8:return this._advance(),z.create(L,this._value());case 13:return this._advance(),t.in(L,this._value());default:return t.has(L)}}case 20:throw this._parsingErrors.push({message:m,offset:R.offset,lexeme:"",additionalInfo:y}),T._parseError;default:throw this._errExpectedButGot(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const R=this._peek();switch(R.type){case 17:case 18:return this._advance(),R.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(R){return R.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(R){return this._check(R)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(R,L){if(this._check(R))return this._advance();throw this._errExpectedButGot(L,this._peek())}_errExpectedButGot(R,L,N){const W=(0,k.localize)(8,null,R,A.Scanner.getLexeme(L)),X=L.offset,ne=A.Scanner.getLexeme(L);return this._parsingErrors.push({message:W,offset:X,lexeme:ne,additionalInfo:N}),T._parseError}_check(R){return this._peek().type===R}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}}e.Parser=T;class t{static false(){return i.INSTANCE}static true(){return r.INSTANCE}static has(R){return a.create(R)}static equals(R,L){return E.create(R,L)}static notEquals(R,L){return C.create(R,L)}static regex(R,L){return H.create(R,L)}static in(R,L){return v.create(R,L)}static notIn(R,L){return u.create(R,L)}static not(R){return U.create(R)}static and(...R){return K.create(R,null,!0)}static or(...R){return x.create(R,null,!0)}static greater(R,L){return M.create(R,L)}static greaterEquals(R,L){return z.create(R,L)}static smaller(R,L){return V.create(R,L)}static smallerEquals(R,L){return J.create(R,L)}static{this._parser=new T({regexParsingWithErrorRecovery:!1})}static deserialize(R){return R==null?void 0:this._parser.parse(R)}}e.ContextKeyExpr=t;function o($){const R=new T({regexParsingWithErrorRecovery:!1});return $.map(L=>(R.parse(L),R.lexingErrors.length>0?R.lexingErrors.map(N=>({errorMessage:N.additionalInfo?(0,k.localize)(9,null,N.additionalInfo):(0,k.localize)(10,null),offset:N.offset,length:N.lexeme.length})):R.parsingErrors.length>0?R.parsingErrors.map(N=>({errorMessage:N.additionalInfo?`${N.message}. ${N.additionalInfo}`:N.message,offset:N.offset,length:N.lexeme.length})):[]))}e.validateWhenClauses=o;function n($,R){const L=$?$.substituteConstants():void 0,N=R?R.substituteConstants():void 0;return!L&&!N?!0:!L||!N?!1:L.equals(N)}e.expressionsAreEqualWithConstantSubstitution=n;function s($,R){return $.cmp(R)}class i{static{this.INSTANCE=new i}constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}map(R){return this}negate(){return r.INSTANCE}}e.ContextKeyFalseExpr=i;class r{static{this.INSTANCE=new r}constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}map(R){return this}negate(){return i.INSTANCE}}e.ContextKeyTrueExpr=r;class a{static create(R,L=null){const N=b.get(R);return typeof N=="boolean"?N?r.INSTANCE:i.INSTANCE:new a(R,L)}constructor(R,L){this.key=R,this.negated=L,this.type=2}cmp(R){return R.type!==this.type?this.type-R.type:j(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=b.get(this.key);return typeof R=="boolean"?R?r.INSTANCE:i.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(R){return R.mapDefined(this.key)}negate(){return this.negated||(this.negated=U.create(this.key,this)),this.negated}}e.ContextKeyDefinedExpr=a;class E{static create(R,L,N=null){if(typeof L=="boolean")return L?a.create(R,N):U.create(R,N);const W=b.get(R);return typeof W=="boolean"?L===(W?"true":"false")?r.INSTANCE:i.INSTANCE:new E(R,L,N)}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=4}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=b.get(this.key);if(typeof R=="boolean"){const L=R?"true":"false";return this.value===L?r.INSTANCE:i.INSTANCE}return this}evaluate(R){return R.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(R){return R.mapEquals(this.key,this.value)}negate(){return this.negated||(this.negated=C.create(this.key,this.value,this)),this.negated}}e.ContextKeyEqualsExpr=E;class v{static create(R,L){return new v(R,L)}constructor(R,L){this.key=R,this.valueKey=L,this.type=10,this.negated=null}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const L=R.getValue(this.valueKey),N=R.getValue(this.key);return Array.isArray(L)?L.includes(N):typeof N=="string"&&typeof L=="object"&&L!==null?P.call(L,N):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(R){return R.mapIn(this.key,this.valueKey)}negate(){return this.negated||(this.negated=u.create(this.key,this.valueKey)),this.negated}}e.ContextKeyInExpr=v;class u{static create(R,L){return new u(R,L)}constructor(R,L){this.key=R,this.valueKey=L,this.type=11,this._negated=v.create(R,L)}cmp(R){return R.type!==this.type?this.type-R.type:this._negated.cmp(R._negated)}equals(R){return R.type===this.type?this._negated.equals(R._negated):!1}substituteConstants(){return this}evaluate(R){return!this._negated.evaluate(R)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(R){return R.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}}e.ContextKeyNotInExpr=u;class C{static create(R,L,N=null){if(typeof L=="boolean")return L?U.create(R,N):a.create(R,N);const W=b.get(R);return typeof W=="boolean"?L===(W?"true":"false")?i.INSTANCE:r.INSTANCE:new C(R,L,N)}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=5}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=b.get(this.key);if(typeof R=="boolean"){const L=R?"true":"false";return this.value===L?i.INSTANCE:r.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(R){return R.mapNotEquals(this.key,this.value)}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}e.ContextKeyNotEqualsExpr=C;class U{static create(R,L=null){const N=b.get(R);return typeof N=="boolean"?N?i.INSTANCE:r.INSTANCE:new U(R,L)}constructor(R,L){this.key=R,this.negated=L,this.type=3}cmp(R){return R.type!==this.type?this.type-R.type:j(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=b.get(this.key);return typeof R=="boolean"?R?i.INSTANCE:r.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(R){return R.mapNot(this.key)}negate(){return this.negated||(this.negated=a.create(this.key,this)),this.negated}}e.ContextKeyNotExpr=U;function F($,R){if(typeof $=="string"){const L=parseFloat($);isNaN(L)||($=L)}return typeof $=="string"||typeof $=="number"?R($):i.INSTANCE}class M{static create(R,L,N=null){return F(L,W=>new M(R,W,N))}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=12}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(R){return R.mapGreater(this.key,this.value)}negate(){return this.negated||(this.negated=J.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterExpr=M;class z{static create(R,L,N=null){return F(L,W=>new z(R,W,N))}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=13}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(R){return R.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||(this.negated=V.create(this.key,this.value,this)),this.negated}}e.ContextKeyGreaterEqualsExpr=z;class V{static create(R,L,N=null){return F(L,W=>new V(R,W,N))}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=14}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(R){return R.mapSmaller(this.key,this.value)}negate(){return this.negated||(this.negated=z.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerExpr=V;class J{static create(R,L,N=null){return F(L,W=>new J(R,W,N))}constructor(R,L,N){this.key=R,this.value=L,this.negated=N,this.type=15}cmp(R){return R.type!==this.type?this.type-R.type:Z(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(R){return R.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||(this.negated=M.create(this.key,this.value,this)),this.negated}}e.ContextKeySmallerEqualsExpr=J;class H{static create(R,L){return new H(R,L)}constructor(R,L){this.key=R,this.regexp=L,this.type=7,this.negated=null}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.key<R.key)return-1;if(this.key>R.key)return 1;const L=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return L<N?-1:L>N?1:0}equals(R){if(R.type===this.type){const L=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return this.key===R.key&&L===N}return!1}substituteConstants(){return this}evaluate(R){const L=R.getValue(this.key);return this.regexp?this.regexp.test(L):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}map(R){return R.mapRegex(this.key,this.regexp)}negate(){return this.negated||(this.negated=Y.create(this)),this.negated}}e.ContextKeyRegexExpr=H;class Y{static create(R){return new Y(R)}constructor(R){this._actual=R,this.type=8}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(R){return new Y(this._actual.map(R))}negate(){return this._actual}}e.ContextKeyNotRegexExpr=Y;function B($){let R=null;for(let L=0,N=$.length;L<N;L++){const W=$[L].substituteConstants();if($[L]!==W&&R===null){R=[];for(let X=0;X<L;X++)R[X]=$[X]}R!==null&&(R[L]=W)}return R===null?$:R}class K{static create(R,L,N){return K._normalizeArr(R,L,N)}constructor(R,L){this.expr=R,this.negated=L,this.type=6}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let L=0,N=this.expr.length;L<N;L++){const W=s(this.expr[L],R.expr[L]);if(W!==0)return W}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let L=0,N=this.expr.length;L<N;L++)if(!this.expr[L].equals(R.expr[L]))return!1;return!0}return!1}substituteConstants(){const R=B(this.expr);return R===this.expr?this:K.create(R,this.negated,!1)}evaluate(R){for(let L=0,N=this.expr.length;L<N;L++)if(!this.expr[L].evaluate(R))return!1;return!0}static _normalizeArr(R,L,N){const W=[];let X=!1;for(const ne of R)if(ne){if(ne.type===1){X=!0;continue}if(ne.type===0)return i.INSTANCE;if(ne.type===6){W.push(...ne.expr);continue}W.push(ne)}if(W.length===0&&X)return r.INSTANCE;if(W.length!==0){if(W.length===1)return W[0];W.sort(s);for(let ne=1;ne<W.length;ne++)W[ne-1].equals(W[ne])&&(W.splice(ne,1),ne--);if(W.length===1)return W[0];for(;W.length>1;){const ne=W[W.length-1];if(ne.type!==9)break;W.pop();const re=W.pop(),Q=W.length===0,ee=x.create(ne.expr.map(ie=>K.create([ie,re],null,N)),null,Q);ee&&(W.push(ee),W.sort(s))}if(W.length===1)return W[0];if(N){for(let ne=0;ne<W.length;ne++)for(let re=ne+1;re<W.length;re++)if(W[ne].negate().equals(W[re]))return i.INSTANCE;if(W.length===1)return W[0]}return new K(W,L)}}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(const L of this.expr)R.push(...L.keys());return R}map(R){return new K(this.expr.map(L=>L.map(R)),null)}negate(){if(!this.negated){const R=[];for(const L of this.expr)R.push(L.negate());this.negated=x.create(R,this,!0)}return this.negated}}e.ContextKeyAndExpr=K;class x{static create(R,L,N){return x._normalizeArr(R,L,N)}constructor(R,L){this.expr=R,this.negated=L,this.type=9}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.length<R.expr.length)return-1;if(this.expr.length>R.expr.length)return 1;for(let L=0,N=this.expr.length;L<N;L++){const W=s(this.expr[L],R.expr[L]);if(W!==0)return W}return 0}equals(R){if(R.type===this.type){if(this.expr.length!==R.expr.length)return!1;for(let L=0,N=this.expr.length;L<N;L++)if(!this.expr[L].equals(R.expr[L]))return!1;return!0}return!1}substituteConstants(){const R=B(this.expr);return R===this.expr?this:x.create(R,this.negated,!1)}evaluate(R){for(let L=0,N=this.expr.length;L<N;L++)if(this.expr[L].evaluate(R))return!0;return!1}static _normalizeArr(R,L,N){let W=[],X=!1;if(R){for(let ne=0,re=R.length;ne<re;ne++){const Q=R[ne];if(Q){if(Q.type===0){X=!0;continue}if(Q.type===1)return r.INSTANCE;if(Q.type===9){W=W.concat(Q.expr);continue}W.push(Q)}}if(W.length===0&&X)return i.INSTANCE;W.sort(s)}if(W.length!==0){if(W.length===1)return W[0];for(let ne=1;ne<W.length;ne++)W[ne-1].equals(W[ne])&&(W.splice(ne,1),ne--);if(W.length===1)return W[0];if(N){for(let ne=0;ne<W.length;ne++)for(let re=ne+1;re<W.length;re++)if(W[ne].negate().equals(W[re]))return r.INSTANCE;if(W.length===1)return W[0]}return new x(W,L)}}serialize(){return this.expr.map(R=>R.serialize()).join(" || ")}keys(){const R=[];for(const L of this.expr)R.push(...L.keys());return R}map(R){return new x(this.expr.map(L=>L.map(R)),null)}negate(){if(!this.negated){const R=[];for(const L of this.expr)R.push(L.negate());for(;R.length>1;){const L=R.shift(),N=R.shift(),W=[];for(const X of ae(L))for(const ne of ae(N))W.push(K.create([X,ne],null,!1));R.unshift(x.create(W,null,!1))}this.negated=x.create(R,this,!0)}return this.negated}}e.ContextKeyOrExpr=x;class q extends a{static{this._info=[]}static all(){return q._info.values()}constructor(R,L,N){super(R,null),this._defaultValue=L,typeof N=="object"?q._info.push({...N,key:R}):N!==!0&&q._info.push({key:R,description:N,type:L!=null?typeof L:void 0})}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return E.create(this.key,R)}notEqualsTo(R){return C.create(this.key,R)}}e.RawContextKey=q,e.IContextKeyService=(0,_.createDecorator)("contextKeyService");function j($,R){return $<R?-1:$>R?1:0}function Z($,R,L,N){return $<L?-1:$>L?1:R<N?-1:R>N?1:0}function oe($,R){if($.type===0||R.type===1)return!0;if($.type===9)return R.type===9?ue($.expr,R.expr):!1;if(R.type===9){for(const L of R.expr)if(oe($,L))return!0;return!1}if($.type===6){if(R.type===6)return ue(R.expr,$.expr);for(const L of $.expr)if(oe(L,R))return!0;return!1}return $.equals(R)}e.implies=oe;function ue($,R){let L=0,N=0;for(;L<$.length&&N<R.length;){const W=$[L].cmp(R[N]);if(W<0)return!1;W===0&&L++,N++}return L===$.length}function ae($){return $.type===9?$.expr:[$]}}),define(ce[97],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullDiagnosticsService=e.isRemoteDiagnosticError=e.IDiagnosticsService=e.ID=void 0,e.ID="diagnosticsService",e.IDiagnosticsService=(0,I.createDecorator)(e.ID);function O(_){return!!_.hostName&&!!_.errorMessage}e.isRemoteDiagnosticError=O;class A{async getPerformanceInfo(k,D){return{}}async getSystemInfo(k,D){return{processArgs:"nullProcessArgs",gpuStatus:"nullGpuStatus",screenReader:"nullScreenReader",remoteData:[],os:"nullOs",memory:"nullMemory",vmHint:"nullVmHint"}}async getDiagnostics(k,D){return""}async getWorkspaceFileExtensions(k){return{extensions:[]}}async reportWorkspaceStats(k){}}e.NullDiagnosticsService=A}),define(ce[98],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IDownloadService=void 0,e.IDownloadService=(0,I.createDecorator)("downloadService")}),define(ce[15],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INativeEnvironmentService=e.IEnvironmentService=void 0,e.IEnvironmentService=(0,I.createDecorator)("environmentService"),e.INativeEnvironmentService=(0,I.refineServiceDecorator)(e.IEnvironmentService)}),define(ce[29],le([0,1,153,4]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreferencesLocalizedLabel=e.ExtensionsLocalizedLabel=e.ExtensionsLabel=e.IExtensionTipsService=e.IGlobalExtensionEnablementService=e.ENABLED_EXTENSIONS_STORAGE_PATH=e.DISABLED_EXTENSIONS_STORAGE_PATH=e.IExtensionManagementService=e.ExtensionManagementError=e.ExtensionSignaturetErrorCode=e.ExtensionManagementErrorCode=e.IExtensionGalleryService=e.InstallOperation=e.StatisticType=e.SortOrder=e.SortBy=e.isIExtensionIdentifier=e.getFallbackTargetPlarforms=e.isTargetPlatformCompatible=e.isNotWebExtensionInWebTargetPlatform=e.getTargetPlatform=e.toTargetPlatform=e.TargetPlatformToString=e.EXTENSION_INSTALL_DEP_PACK_CONTEXT=e.EXTENSION_INSTALL_SYNC_CONTEXT=e.EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT=e.WEB_EXTENSION_TAG=e.EXTENSION_IDENTIFIER_REGEX=e.EXTENSION_IDENTIFIER_PATTERN=void 0,e.EXTENSION_IDENTIFIER_PATTERN="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",e.EXTENSION_IDENTIFIER_REGEX=new RegExp(e.EXTENSION_IDENTIFIER_PATTERN),e.WEB_EXTENSION_TAG="__web_extension",e.EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT="skipWalkthrough",e.EXTENSION_INSTALL_SYNC_CONTEXT="extensionsSync",e.EXTENSION_INSTALL_DEP_PACK_CONTEXT="dependecyOrPackExtensionInstall";function A(c){switch(c){case"win32-x64":return"Windows 64 bit";case"win32-ia32":return"Windows 32 bit";case"win32-arm64":return"Windows ARM";case"linux-x64":return"Linux 64 bit";case"linux-arm64":return"Linux ARM 64";case"linux-armhf":return"Linux ARM";case"alpine-x64":return"Alpine Linux 64 bit";case"alpine-arm64":return"Alpine ARM 64";case"darwin-x64":return"Mac";case"darwin-arm64":return"Mac Silicon";case"web":return"Web";case"universal":return"universal";case"unknown":return"unknown";case"undefined":return"undefined"}}e.TargetPlatformToString=A;function _(c){switch(c){case"win32-x64":return"win32-x64";case"win32-ia32":return"win32-ia32";case"win32-arm64":return"win32-arm64";case"linux-x64":return"linux-x64";case"linux-arm64":return"linux-arm64";case"linux-armhf":return"linux-armhf";case"alpine-x64":return"alpine-x64";case"alpine-arm64":return"alpine-arm64";case"darwin-x64":return"darwin-x64";case"darwin-arm64":return"darwin-arm64";case"web":return"web";case"universal":return"universal";default:return"unknown"}}e.toTargetPlatform=_;function k(c,m){switch(c){case 3:return m==="x64"?"win32-x64":m==="ia32"?"win32-ia32":m==="arm64"?"win32-arm64":"unknown";case 2:return m==="x64"?"linux-x64":m==="arm64"?"linux-arm64":m==="arm"?"linux-armhf":"unknown";case"alpine":return m==="x64"?"alpine-x64":m==="arm64"?"alpine-arm64":"unknown";case 1:return m==="x64"?"darwin-x64":m==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}e.getTargetPlatform=k;function D(c,m){return m==="web"&&!c.includes("web")}e.isNotWebExtensionInWebTargetPlatform=D;function b(c,m,y){return D(m,y)?!1:c==="undefined"||c==="universal"?!0:c==="unknown"?!1:c===y?!0:S(y).includes(c)}e.isTargetPlatformCompatible=b;function S(c){switch(c){case"win32-x64":return["win32-ia32"];case"win32-arm64":return["win32-ia32"]}return[]}e.getFallbackTargetPlarforms=S;function P(c){return c&&typeof c=="object"&&typeof c.id=="string"&&(!c.uuid||typeof c.uuid=="string")}e.isIExtensionIdentifier=P;var p;(function(c){c[c.NoneOrRelevance=0]="NoneOrRelevance",c[c.LastUpdatedDate=1]="LastUpdatedDate",c[c.Title=2]="Title",c[c.PublisherName=3]="PublisherName",c[c.InstallCount=4]="InstallCount",c[c.PublishedDate=10]="PublishedDate",c[c.AverageRating=6]="AverageRating",c[c.WeightedRating=12]="WeightedRating"})(p||(e.SortBy=p={}));var g;(function(c){c[c.Default=0]="Default",c[c.Ascending=1]="Ascending",c[c.Descending=2]="Descending"})(g||(e.SortOrder=g={}));var h;(function(c){c.Install="install",c.Uninstall="uninstall"})(h||(e.StatisticType=h={}));var f;(function(c){c[c.None=1]="None",c[c.Install=2]="Install",c[c.Update=3]="Update",c[c.Migrate=4]="Migrate"})(f||(e.InstallOperation=f={})),e.IExtensionGalleryService=(0,O.createDecorator)("extensionGalleryService");var w;(function(c){c.Unsupported="Unsupported",c.Deprecated="Deprecated",c.Malicious="Malicious",c.Incompatible="Incompatible",c.IncompatibleTargetPlatform="IncompatibleTargetPlatform",c.ReleaseVersionNotFound="ReleaseVersionNotFound",c.Invalid="Invalid",c.Download="Download",c.Extract="Extract",c.Delete="Delete",c.Rename="Rename",c.CorruptZip="CorruptZip",c.IncompleteZip="IncompleteZip",c.Signature="Signature",c.Internal="Internal"})(w||(e.ExtensionManagementErrorCode=w={}));var l;(function(c){c.UnknownError="UnknownError",c.PackageIsInvalidZip="PackageIsInvalidZip",c.SignatureArchiveIsInvalidZip="SignatureArchiveIsInvalidZip"})(l||(e.ExtensionSignaturetErrorCode=l={}));class d extends Error{constructor(m,y){super(m),this.code=y,this.name=y}}e.ExtensionManagementError=d,e.IExtensionManagementService=(0,O.createDecorator)("extensionManagementService"),e.DISABLED_EXTENSIONS_STORAGE_PATH="extensionsIdentifiers/disabled",e.ENABLED_EXTENSIONS_STORAGE_PATH="extensionsIdentifiers/enabled",e.IGlobalExtensionEnablementService=(0,O.createDecorator)("IGlobalExtensionEnablementService"),e.IExtensionTipsService=(0,O.createDecorator)("IExtensionTipsService"),e.ExtensionsLabel=(0,I.localize)(0,null),e.ExtensionsLocalizedLabel={value:e.ExtensionsLabel,original:"Extensions"},e.PreferencesLocalizedLabel={value:(0,I.localize)(1,null),original:"Preferences"}}),define(ce[188],le([0,1,3,2,30,11,94,29]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionTipsChannel=e.ExtensionManagementChannelClient=e.ExtensionManagementChannel=void 0;function b(l,d){return l?_.URI.revive(d?d.transformIncoming(l):l):void 0}function S(l,d){return d?d.transformOutgoingURI(l):l}function P(l,d){d=d||k.DefaultURITransformer;const c=l.manifest;return{...(0,k.transformAndReviveIncomingURIs)({...l,manifest:void 0},d),manifest:c}}function p(l,d){return l?.profileLocation?(0,k.transformAndReviveIncomingURIs)(l,d??k.DefaultURITransformer):l}function g(l,d){return d?(0,A.cloneAndChange)(l,c=>c instanceof _.URI?d.transformOutgoingURI(c):void 0):l}class h{constructor(d,c){this.service=d,this.getUriTransformer=c,this.onInstallExtension=I.Event.buffer(d.onInstallExtension,!0),this.onDidInstallExtensions=I.Event.buffer(d.onDidInstallExtensions,!0),this.onUninstallExtension=I.Event.buffer(d.onUninstallExtension,!0),this.onDidUninstallExtension=I.Event.buffer(d.onDidUninstallExtension,!0),this.onDidUpdateExtensionMetadata=I.Event.buffer(d.onDidUpdateExtensionMetadata,!0)}listen(d,c){const m=this.getUriTransformer(d);switch(c){case"onInstallExtension":return I.Event.map(this.onInstallExtension,y=>({...y,profileLocation:y.profileLocation?S(y.profileLocation,m):y.profileLocation}));case"onDidInstallExtensions":return I.Event.map(this.onDidInstallExtensions,y=>y.map(T=>({...T,local:T.local?g(T.local,m):T.local,profileLocation:T.profileLocation?S(T.profileLocation,m):T.profileLocation})));case"onUninstallExtension":return I.Event.map(this.onUninstallExtension,y=>({...y,profileLocation:y.profileLocation?S(y.profileLocation,m):y.profileLocation}));case"onDidUninstallExtension":return I.Event.map(this.onDidUninstallExtension,y=>({...y,profileLocation:y.profileLocation?S(y.profileLocation,m):y.profileLocation}));case"onDidUpdateExtensionMetadata":return I.Event.map(this.onDidUpdateExtensionMetadata,y=>g(y,m))}throw new Error("Invalid listen")}async call(d,c,m){const y=this.getUriTransformer(d);switch(c){case"zip":{const T=P(m[0],y),t=await this.service.zip(T);return S(t,y)}case"unzip":return this.service.unzip(b(m[0],y));case"install":return this.service.install(b(m[0],y),p(m[1],y));case"installFromLocation":return this.service.installFromLocation(b(m[0],y),b(m[1],y));case"installExtensionsFromProfile":return this.service.installExtensionsFromProfile(m[0],b(m[1],y),b(m[2],y));case"getManifest":return this.service.getManifest(b(m[0],y));case"getTargetPlatform":return this.service.getTargetPlatform();case"canInstall":return this.service.canInstall(m[0]);case"installFromGallery":return this.service.installFromGallery(m[0],p(m[1],y));case"installGalleryExtensions":{const T=m[0];return this.service.installGalleryExtensions(T.map(({extension:t,options:o})=>({extension:t,options:p(o,y)??{}})))}case"uninstall":return this.service.uninstall(P(m[0],y),p(m[1],y));case"reinstallFromGallery":return this.service.reinstallFromGallery(P(m[0],y));case"getInstalled":return(await this.service.getInstalled(m[0],b(m[1],y))).map(t=>g(t,y));case"toggleAppliationScope":{const T=await this.service.toggleAppliationScope(P(m[0],y),b(m[1],y));return g(T,y)}case"copyExtensions":return this.service.copyExtensions(b(m[0],y),b(m[1],y));case"updateMetadata":{const T=await this.service.updateMetadata(P(m[0],y),m[1],b(m[2],y));return g(T,y)}case"getExtensionsControlManifest":return this.service.getExtensionsControlManifest();case"download":return this.service.download(m[0],m[1],m[2]);case"cleanUp":return this.service.cleanUp()}throw new Error("Invalid call")}}e.ExtensionManagementChannel=h;class f extends O.Disposable{get onInstallExtension(){return this._onInstallExtension.event}get onDidInstallExtensions(){return this._onDidInstallExtensions.event}get onUninstallExtension(){return this._onUninstallExtension.event}get onDidUninstallExtension(){return this._onDidUninstallExtension.event}get onDidUpdateExtensionMetadata(){return this._onDidUpdateExtensionMetadata.event}constructor(d){super(),this.channel=d,this._onInstallExtension=this._register(new I.Emitter),this._onDidInstallExtensions=this._register(new I.Emitter),this._onUninstallExtension=this._register(new I.Emitter),this._onDidUninstallExtension=this._register(new I.Emitter),this._onDidUpdateExtensionMetadata=this._register(new I.Emitter),this._register(this.channel.listen("onInstallExtension")(c=>this.fireEvent(this._onInstallExtension,{...c,source:this.isUriComponents(c.source)?_.URI.revive(c.source):c.source,profileLocation:_.URI.revive(c.profileLocation)}))),this._register(this.channel.listen("onDidInstallExtensions")(c=>this.fireEvent(this._onDidInstallExtensions,c.map(m=>({...m,local:m.local?P(m.local,null):m.local,source:this.isUriComponents(m.source)?_.URI.revive(m.source):m.source,profileLocation:_.URI.revive(m.profileLocation)}))))),this._register(this.channel.listen("onUninstallExtension")(c=>this.fireEvent(this._onUninstallExtension,{...c,profileLocation:_.URI.revive(c.profileLocation)}))),this._register(this.channel.listen("onDidUninstallExtension")(c=>this.fireEvent(this._onDidUninstallExtension,{...c,profileLocation:_.URI.revive(c.profileLocation)}))),this._register(this.channel.listen("onDidUpdateExtensionMetadata")(c=>this._onDidUpdateExtensionMetadata.fire(P(c,null))))}fireEvent(d,c){d.fire(c)}isUriComponents(d){return d?typeof d.path=="string"&&typeof d.scheme=="string":!1}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=this.channel.call("getTargetPlatform")),this._targetPlatformPromise}async canInstall(d){const c=await this.getTargetPlatform();return d.allTargetPlatforms.some(m=>(0,D.isTargetPlatformCompatible)(m,d.allTargetPlatforms,c))}zip(d){return Promise.resolve(this.channel.call("zip",[d]).then(c=>_.URI.revive(c)))}unzip(d){return Promise.resolve(this.channel.call("unzip",[d]))}install(d,c){return Promise.resolve(this.channel.call("install",[d,c])).then(m=>P(m,null))}installFromLocation(d,c){return Promise.resolve(this.channel.call("installFromLocation",[d,c])).then(m=>P(m,null))}async installExtensionsFromProfile(d,c,m){return(await this.channel.call("installExtensionsFromProfile",[d,c,m])).map(T=>P(T,null))}getManifest(d){return Promise.resolve(this.channel.call("getManifest",[d]))}installFromGallery(d,c){return Promise.resolve(this.channel.call("installFromGallery",[d,c])).then(m=>P(m,null))}async installGalleryExtensions(d){return(await this.channel.call("installGalleryExtensions",[d])).map(m=>({...m,local:m.local?P(m.local,null):m.local,source:this.isUriComponents(m.source)?_.URI.revive(m.source):m.source,profileLocation:_.URI.revive(m.profileLocation)}))}uninstall(d,c){return Promise.resolve(this.channel.call("uninstall",[d,c]))}reinstallFromGallery(d){return Promise.resolve(this.channel.call("reinstallFromGallery",[d])).then(c=>P(c,null))}getInstalled(d=null,c){return Promise.resolve(this.channel.call("getInstalled",[d,c])).then(m=>m.map(y=>P(y,null)))}updateMetadata(d,c,m){return Promise.resolve(this.channel.call("updateMetadata",[d,c,m])).then(y=>P(y,null))}toggleAppliationScope(d,c){return this.channel.call("toggleAppliationScope",[d,c]).then(m=>P(m,null))}copyExtensions(d,c){return this.channel.call("copyExtensions",[d,c])}getExtensionsControlManifest(){return Promise.resolve(this.channel.call("getExtensionsControlManifest"))}async download(d,c,m){const y=await this.channel.call("download",[d,c,m]);return _.URI.revive(y)}async cleanUp(){return this.channel.call("cleanUp")}registerParticipant(){throw new Error("Not Supported")}}e.ExtensionManagementChannelClient=f;class w{constructor(d){this.service=d}listen(d,c){throw new Error("Invalid listen")}call(d,c,m){switch(c){case"getConfigBasedTips":return this.service.getConfigBasedTips(_.URI.revive(m[0]));case"getImportantExecutableBasedTips":return this.service.getImportantExecutableBasedTips();case"getOtherExecutableBasedTips":return this.service.getOtherExecutableBasedTips()}throw new Error("Invalid call")}}e.ExtensionTipsChannel=w}),define(ce[99],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionSignatureVerificationService=e.IExtensionSignatureVerificationService=void 0,e.IExtensionSignatureVerificationService=(0,I.createDecorator)("IExtensionSignatureVerificationService");class O{vsceSign(){return this.moduleLoadingPromise||(this.moduleLoadingPromise=new Promise((_,k)=>te(["node-vsce-sign"],async D=>_(D),k))),this.moduleLoadingPromise}async verify(_,k,D){let b;try{b=await this.vsceSign()}catch{return!1}return b.verify(_,k,D)}}e.ExtensionSignatureVerificationService=O}),define(ce[100],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IExtensionRecommendationNotificationService=e.RecommendationsNotificationResult=e.RecommendationSourceToString=e.RecommendationSource=void 0;var O;(function(k){k[k.FILE=1]="FILE",k[k.WORKSPACE=2]="WORKSPACE",k[k.EXE=3]="EXE"})(O||(e.RecommendationSource=O={}));function A(k){switch(k){case 1:return"file";case 2:return"workspace";case 3:return"exe"}}e.RecommendationSourceToString=A;var _;(function(k){k.Ignored="ignored",k.Cancelled="cancelled",k.TooMany="toomany",k.IncompatibleWindow="incompatibleWindow",k.Accepted="reacted"})(_||(e.RecommendationsNotificationResult=_={})),e.IExtensionRecommendationNotificationService=(0,I.createDecorator)("IExtensionRecommendationNotificationService")}),define(ce[13],le([0,1,47,16,28,12,11,160,4,6,26]),function(te,e,I,O,A,_,k,D,b,S,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLargeFileConfirmationLimit=e.ByteSize=e.whenProviderRegistered=e.etag=e.ETAG_DISABLED=e.FileKind=e.FILES_READONLY_FROM_PERMISSIONS_CONFIG=e.FILES_READONLY_EXCLUDE_CONFIG=e.FILES_READONLY_INCLUDE_CONFIG=e.FILES_EXCLUDE_CONFIG=e.FILES_ASSOCIATIONS_CONFIG=e.HotExitConfiguration=e.AutoSaveConfiguration=e.FileOperationResult=e.NotModifiedSinceFileOperationError=e.TooLargeFileOperationError=e.FileOperationError=e.isParent=e.FileChangesEvent=e.FileChangeType=e.FileOperationEvent=e.FileOperation=e.toFileOperationResult=e.toFileSystemProviderErrorCode=e.markAsFileSystemProviderError=e.ensureFileSystemProviderError=e.createFileSystemProviderError=e.FileSystemProviderError=e.FileSystemProviderErrorCode=e.hasReadonlyCapability=e.hasFileAtomicDeleteCapability=e.hasFileAtomicWriteCapability=e.hasFileAtomicReadCapability=e.hasFileReadStreamCapability=e.hasOpenReadWriteCloseCapability=e.hasFileCloneCapability=e.hasFileFolderCopyCapability=e.hasReadWriteCapability=e.FileSystemProviderCapabilities=e.FilePermission=e.FileType=e.isFileOpenForWriteOptions=e.IFileService=void 0,e.IFileService=(0,b.createDecorator)("fileService");function p(j){return j.create===!0}e.isFileOpenForWriteOptions=p;var g;(function(j){j[j.Unknown=0]="Unknown",j[j.File=1]="File",j[j.Directory=2]="Directory",j[j.SymbolicLink=64]="SymbolicLink"})(g||(e.FileType=g={}));var h;(function(j){j[j.Readonly=1]="Readonly",j[j.Locked=2]="Locked"})(h||(e.FilePermission=h={}));var f;(function(j){j[j.None=0]="None",j[j.FileReadWrite=2]="FileReadWrite",j[j.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",j[j.FileReadStream=16]="FileReadStream",j[j.FileFolderCopy=8]="FileFolderCopy",j[j.PathCaseSensitive=1024]="PathCaseSensitive",j[j.Readonly=2048]="Readonly",j[j.Trash=4096]="Trash",j[j.FileWriteUnlock=8192]="FileWriteUnlock",j[j.FileAtomicRead=16384]="FileAtomicRead",j[j.FileAtomicWrite=32768]="FileAtomicWrite",j[j.FileAtomicDelete=65536]="FileAtomicDelete",j[j.FileClone=131072]="FileClone"})(f||(e.FileSystemProviderCapabilities=f={}));function w(j){return!!(j.capabilities&2)}e.hasReadWriteCapability=w;function l(j){return!!(j.capabilities&8)}e.hasFileFolderCopyCapability=l;function d(j){return!!(j.capabilities&131072)}e.hasFileCloneCapability=d;function c(j){return!!(j.capabilities&4)}e.hasOpenReadWriteCloseCapability=c;function m(j){return!!(j.capabilities&16)}e.hasFileReadStreamCapability=m;function y(j){return w(j)?!!(j.capabilities&16384):!1}e.hasFileAtomicReadCapability=y;function T(j){return w(j)?!!(j.capabilities&32768):!1}e.hasFileAtomicWriteCapability=T;function t(j){return!!(j.capabilities&65536)}e.hasFileAtomicDeleteCapability=t;function o(j){return!!(j.capabilities&2048)}e.hasReadonlyCapability=o;var n;(function(j){j.FileExists="EntryExists",j.FileNotFound="EntryNotFound",j.FileNotADirectory="EntryNotADirectory",j.FileIsADirectory="EntryIsADirectory",j.FileExceedsStorageQuota="EntryExceedsStorageQuota",j.FileTooLarge="EntryTooLarge",j.FileWriteLocked="EntryWriteLocked",j.NoPermissions="NoPermissions",j.Unavailable="Unavailable",j.Unknown="Unknown"})(n||(e.FileSystemProviderErrorCode=n={}));class s extends Error{static create(Z,oe){const ue=new s(Z.toString(),oe);return a(ue,oe),ue}constructor(Z,oe){super(Z),this.code=oe}}e.FileSystemProviderError=s;function i(j,Z){return s.create(j,Z)}e.createFileSystemProviderError=i;function r(j){return j||i((0,D.localize)(0,null),n.Unknown)}e.ensureFileSystemProviderError=r;function a(j,Z){return j.name=Z?`${Z} (FileSystemError)`:"FileSystemError",j}e.markAsFileSystemProviderError=a;function E(j){if(!j)return n.Unknown;if(j instanceof s)return j.code;const Z=/^(.+) \(FileSystemError\)$/.exec(j.name);if(!Z)return n.Unknown;switch(Z[1]){case n.FileExists:return n.FileExists;case n.FileIsADirectory:return n.FileIsADirectory;case n.FileNotADirectory:return n.FileNotADirectory;case n.FileNotFound:return n.FileNotFound;case n.FileTooLarge:return n.FileTooLarge;case n.FileWriteLocked:return n.FileWriteLocked;case n.NoPermissions:return n.NoPermissions;case n.Unavailable:return n.Unavailable}return n.Unknown}e.toFileSystemProviderErrorCode=E;function v(j){if(j instanceof z)return j.fileOperationResult;switch(E(j)){case n.FileNotFound:return 1;case n.FileIsADirectory:return 0;case n.FileNotADirectory:return 9;case n.FileWriteLocked:return 5;case n.NoPermissions:return 6;case n.FileExists:return 4;case n.FileTooLarge:return 7;default:return 10}}e.toFileOperationResult=v;var u;(function(j){j[j.CREATE=0]="CREATE",j[j.DELETE=1]="DELETE",j[j.MOVE=2]="MOVE",j[j.COPY=3]="COPY",j[j.WRITE=4]="WRITE"})(u||(e.FileOperation=u={}));class C{constructor(Z,oe,ue){this.resource=Z,this.operation=oe,this.target=ue}isOperation(Z){return this.operation===Z}}e.FileOperationEvent=C;var U;(function(j){j[j.UPDATED=0]="UPDATED",j[j.ADDED=1]="ADDED",j[j.DELETED=2]="DELETED"})(U||(e.FileChangeType=U={}));class F{constructor(Z,oe){this.added=void 0,this.updated=void 0,this.deleted=void 0,this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];const ue=new Map;for(const ae of Z){const $=ue.get(ae.type);switch($?$.push([ae.resource,ae]):ue.set(ae.type,[[ae.resource,ae]]),ae.type){case 1:this.rawAdded.push(ae.resource);break;case 0:this.rawUpdated.push(ae.resource);break;case 2:this.rawDeleted.push(ae.resource);break}}for(const[ae,$]of ue)switch(ae){case 1:this.added=I.TernarySearchTree.forUris(()=>oe),this.added.fill($);break;case 0:this.updated=I.TernarySearchTree.forUris(()=>oe),this.updated.fill($);break;case 2:this.deleted=I.TernarySearchTree.forUris(()=>oe),this.deleted.fill($);break}}contains(Z,...oe){return this.doContains(Z,{includeChildren:!1},...oe)}affects(Z,...oe){return this.doContains(Z,{includeChildren:!0},...oe)}doContains(Z,oe,...ue){if(!Z)return!1;const ae=ue.length>0;return!!((!ae||ue.includes(1))&&(this.added?.get(Z)||oe.includeChildren&&this.added?.findSuperstr(Z))||(!ae||ue.includes(0))&&(this.updated?.get(Z)||oe.includeChildren&&this.updated?.findSuperstr(Z))||(!ae||ue.includes(2))&&(this.deleted?.findSubstr(Z)||oe.includeChildren&&this.deleted?.findSuperstr(Z)))}gotAdded(){return!!this.added}gotDeleted(){return!!this.deleted}gotUpdated(){return!!this.updated}}e.FileChangesEvent=F;function M(j,Z,oe){return!j||!Z||j===Z||Z.length>j.length?!1:(Z.charAt(Z.length-1)!==O.sep&&(Z+=O.sep),oe?(0,A.startsWithIgnoreCase)(j,Z):j.indexOf(Z)===0)}e.isParent=M;class z extends Error{constructor(Z,oe,ue){super(Z),this.fileOperationResult=oe,this.options=ue}}e.FileOperationError=z;class V extends z{constructor(Z,oe,ue,ae){super(Z,oe,ae),this.fileOperationResult=oe,this.size=ue}}e.TooLargeFileOperationError=V;class J extends z{constructor(Z,oe,ue){super(Z,2,ue),this.stat=oe}}e.NotModifiedSinceFileOperationError=J;var H;(function(j){j[j.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",j[j.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",j[j.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",j[j.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",j[j.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",j[j.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",j[j.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",j[j.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",j[j.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",j[j.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",j[j.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(H||(e.FileOperationResult=H={})),e.AutoSaveConfiguration={OFF:"off",AFTER_DELAY:"afterDelay",ON_FOCUS_CHANGE:"onFocusChange",ON_WINDOW_CHANGE:"onWindowChange"},e.HotExitConfiguration={OFF:"off",ON_EXIT:"onExit",ON_EXIT_AND_WINDOW_CLOSE:"onExitAndWindowClose"},e.FILES_ASSOCIATIONS_CONFIG="files.associations",e.FILES_EXCLUDE_CONFIG="files.exclude",e.FILES_READONLY_INCLUDE_CONFIG="files.readonlyInclude",e.FILES_READONLY_EXCLUDE_CONFIG="files.readonlyExclude",e.FILES_READONLY_FROM_PERMISSIONS_CONFIG="files.readonlyFromPermissions";var Y;(function(j){j[j.FILE=0]="FILE",j[j.FOLDER=1]="FOLDER",j[j.ROOT_FOLDER=2]="ROOT_FOLDER"})(Y||(e.FileKind=Y={})),e.ETAG_DISABLED="";function B(j){if(!(typeof j.size!="number"||typeof j.mtime!="number"))return j.mtime.toString(29)+j.size.toString(31)}e.etag=B;async function K(j,Z){if(!Z.hasProvider(k.URI.from({scheme:j.scheme})))return new Promise(oe=>{const ue=Z.onDidChangeFileSystemProviderRegistrations(ae=>{ae.scheme===j.scheme&&ae.added&&(ue.dispose(),oe())})})}e.whenProviderRegistered=K;class x{static{this.KB=1024}static{this.MB=x.KB*x.KB}static{this.GB=x.MB*x.KB}static{this.TB=x.GB*x.KB}static formatSize(Z){return(0,_.isNumber)(Z)||(Z=0),Z<x.KB?(0,D.localize)(1,null,Z.toFixed(0)):Z<x.MB?(0,D.localize)(2,null,(Z/x.KB).toFixed(2)):Z<x.GB?(0,D.localize)(3,null,(Z/x.MB).toFixed(2)):Z<x.TB?(0,D.localize)(4,null,(Z/x.GB).toFixed(2)):(0,D.localize)(5,null,(Z/x.TB).toFixed(2))}}e.ByteSize=x;function q(j){const Z=typeof j=="string"||j?.scheme===P.Schemas.vscodeRemote;return typeof j!="string"&&j?.scheme===P.Schemas.file?1024*x.MB:Z?10*x.MB:S.isWeb?50*x.MB:1024*x.MB}e.getLargeFileConfirmationLimit=q});var G=this&&this.__param||function(te,e){return function(I,O){e(I,O,te)}};define(ce[189],le([0,1,68,43,13]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChecksumService=void 0;let _=class{constructor(D){this.fileService=D}async checksum(D){const b=(await this.fileService.readFileStream(D)).value;return new Promise((S,P)=>{const p=(0,I.createHash)("md5");(0,O.listenStream)(b,{onData:g=>p.update(g.buffer),onError:g=>P(g),onEnd:()=>S(p.digest("base64").replace(/=+$/,""))})})}};e.ChecksumService=_,e.ChecksumService=_=Ee([G(0,A.IFileService)],_)}),define(ce[190],le([0,1,14,38,8,3,2,43,11,32,13]),function(te,e,I,O,A,_,k,D,b,S,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileSystemProviderClient=e.LOCAL_FILE_SYSTEM_CHANNEL_NAME=void 0,e.LOCAL_FILE_SYSTEM_CHANNEL_NAME="localFilesystem";class p extends k.Disposable{constructor(h,f){super(),this.channel=h,this.extraCapabilities=f,this.onDidChangeCapabilities=_.Event.None,this._onDidChange=this._register(new _.Emitter),this.onDidChangeFile=this._onDidChange.event,this._onDidWatchError=this._register(new _.Emitter),this.onDidWatchError=this._onDidWatchError.event,this.sessionId=(0,S.generateUuid)(),this.registerFileChangeListeners()}get capabilities(){return this._capabilities||(this._capabilities=253982,this.extraCapabilities.pathCaseSensitive&&(this._capabilities|=1024),this.extraCapabilities.trash&&(this._capabilities|=4096)),this._capabilities}stat(h){return this.channel.call("stat",[h])}readdir(h){return this.channel.call("readdir",[h])}async readFile(h,f){const{buffer:w}=await this.channel.call("readFile",[h,f]);return w}readFileStream(h,f,w){const l=(0,D.newWriteableStream)(c=>I.VSBuffer.concat(c.map(m=>I.VSBuffer.wrap(m))).buffer),d=this.channel.listen("readFileStream",[h,f])(c=>{if(c instanceof I.VSBuffer)l.write(c.buffer);else{if(c==="end")l.end();else{let m;if(c instanceof Error)m=c;else{const y=c;m=(0,P.createFileSystemProviderError)(y.message??(0,O.toErrorMessage)(y),y.code??P.FileSystemProviderErrorCode.Unknown)}l.error(m),l.end()}d.dispose()}});return w.onCancellationRequested(()=>{l.error((0,A.canceled)()),l.end(),d.dispose()}),l}writeFile(h,f,w){return this.channel.call("writeFile",[h,I.VSBuffer.wrap(f),w])}open(h,f){return this.channel.call("open",[h,f])}close(h){return this.channel.call("close",[h])}async read(h,f,w,l,d){const[c,m]=await this.channel.call("read",[h,f,d]);return w.set(c.buffer.slice(0,m),l),m}write(h,f,w,l,d){return this.channel.call("write",[h,f,I.VSBuffer.wrap(w),l,d])}mkdir(h){return this.channel.call("mkdir",[h])}delete(h,f){return this.channel.call("delete",[h,f])}rename(h,f,w){return this.channel.call("rename",[h,f,w])}copy(h,f,w){return this.channel.call("copy",[h,f,w])}cloneFile(h,f){return this.channel.call("cloneFile",[h,f])}registerFileChangeListeners(){this._register(this.channel.listen("fileChange",[this.sessionId])(h=>{if(Array.isArray(h)){const f=h;this._onDidChange.fire(f.map(w=>({resource:b.URI.revive(w.resource),type:w.type})))}else{const f=h;this._onDidWatchError.fire(f)}}))}watch(h,f){const w=(0,S.generateUuid)();return this.channel.call("watch",[this.sessionId,w,h,f]),(0,k.toDisposable)(()=>this.channel.call("unwatch",[this.sessionId,w]))}}e.DiskFileSystemProviderClient=p}),define(ce[101],le([0,1,14,8,161,13]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.readFileIntoStream=void 0;async function k(P,p,g,h,f,w){let l;try{await D(P,p,g,h,f,w)}catch(d){l=d}finally{l&&f.errorTransformer&&(l=f.errorTransformer(l)),typeof l<"u"&&g.error(l),g.end()}}e.readFileIntoStream=k;async function D(P,p,g,h,f,w){b(w);const l=await P.open(p,{create:!1});try{b(w);let d=0,c=0,m=f&&typeof f.length=="number"?f.length:void 0,y=I.VSBuffer.alloc(Math.min(f.bufferSize,typeof m=="number"?m:f.bufferSize)),T=f&&typeof f.position=="number"?f.position:0,t=0;do c=await P.read(l,T,y.buffer,t,y.byteLength-t),T+=c,t+=c,d+=c,typeof m=="number"&&(m-=c),t===y.byteLength&&(await g.write(h(y)),y=I.VSBuffer.alloc(Math.min(f.bufferSize,typeof m=="number"?m:f.bufferSize)),t=0);while(c>0&&(typeof m!="number"||m>0)&&b(w)&&S(d,f));if(t>0){let o=t;typeof m=="number"&&(o=Math.min(t,m)),g.write(h(y.slice(0,o)))}}catch(d){throw(0,_.ensureFileSystemProviderError)(d)}finally{await P.close(l)}}function b(P){if(P.isCancellationRequested)throw(0,O.canceled)();return!0}function S(P,p){if(typeof p?.limits?.size=="number"&&P>p.limits.size)throw(0,_.createFileSystemProviderError)((0,A.localize)(0,null),_.FileSystemProviderErrorCode.FileTooLarge);return!0}}),define(ce[54],le([0,1,93,2,16,6,11,13]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseWatcherPatterns=e.normalizeWatcherPattern=e.coalesceEvents=e.toFileChanges=e.AbstractUniversalWatcherClient=e.AbstractNonRecursiveWatcherClient=e.AbstractWatcherClient=e.isRecursiveWatchRequest=void 0;function b(d){return d.recursive===!0}e.isRecursiveWatchRequest=b;class S extends O.Disposable{static{this.MAX_RESTARTS=5}constructor(c,m,y,T){super(),this.onFileChanges=c,this.onLogMessage=m,this.verboseLogging=y,this.options=T,this.watcherDisposables=this._register(new O.MutableDisposable),this.requests=void 0,this.restartCounter=0}init(){const c=new O.DisposableStore;this.watcherDisposables.value=c,this.watcher=this.createWatcher(c),this.watcher.setVerboseLogging(this.verboseLogging),c.add(this.watcher.onDidChangeFile(m=>this.onFileChanges(m))),c.add(this.watcher.onDidLogMessage(m=>this.onLogMessage(m))),c.add(this.watcher.onDidError(m=>this.onError(m)))}onError(c){this.options.restartOnError?this.restartCounter<S.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after error: ${c}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after error: ${c}`):this.error(c)}restart(c){this.restartCounter++,this.init(),this.watch(c)}async watch(c){this.requests=c,await this.watcher?.watch(c)}async setVerboseLogging(c){this.verboseLogging=c,await this.watcher?.setVerboseLogging(c)}error(c){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${c}`})}trace(c){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${c}`})}dispose(){return this.watcher=void 0,super.dispose()}}e.AbstractWatcherClient=S;class P extends S{constructor(c,m,y){super(c,m,y,{type:"node.js",restartOnError:!1})}}e.AbstractNonRecursiveWatcherClient=P;class p extends S{constructor(c,m,y){super(c,m,y,{type:"universal",restartOnError:!0})}}e.AbstractUniversalWatcherClient=p;function g(d){return d.map(c=>({type:c.type,resource:k.URI.file(c.path)}))}e.toFileChanges=g;function h(d){const c=new l;for(const m of d)c.processEvent(m);return c.coalesce()}e.coalesceEvents=h;function f(d,c){return typeof c=="string"&&!c.startsWith(I.GLOBSTAR)&&!(0,A.isAbsolute)(c)?{base:d,pattern:c}:c}e.normalizeWatcherPattern=f;function w(d,c){const m=[];for(const y of c)m.push((0,I.parse)(f(d,y)));return m}e.parseWatcherPatterns=w;class l{constructor(){this.coalesced=new Set,this.mapPathToChange=new Map}toKey(c){return _.isLinux?c.path:c.path.toLowerCase()}processEvent(c){const m=this.mapPathToChange.get(this.toKey(c));let y=!1;if(m){const T=m.type,t=c.type;m.path!==c.path&&(c.type===2||c.type===1)?y=!0:T===1&&t===2?(this.mapPathToChange.delete(this.toKey(c)),this.coalesced.delete(m)):T===2&&t===1?m.type=0:T===1&&t===0||(m.type=t)}else y=!0;y&&(this.coalesced.add(c),this.mapPathToChange.set(this.toKey(c),c))}coalesce(){const c=[],m=[];return Array.from(this.coalesced).filter(y=>y.type!==2?(c.push(y),!1):!0).sort((y,T)=>y.path.length-T.path.length).filter(y=>m.some(T=>(0,D.isParent)(y.path,T,!_.isLinux))?!1:(m.push(y.path),!0)).concat(c)}}}),define(ce[191],le([0,1,52,5,25,48,2,88,16,6,144,31,54]),function(te,e,I,O,A,_,k,D,b,S,P,p,g){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.watchFileContents=e.NodeJSFileWatcherLibrary=void 0;class h extends k.Disposable{static{this.FILE_DELETE_HANDLER_DELAY=100}static{this.FILE_CHANGES_HANDLER_DELAY=75}constructor(l,d,c,m){super(),this.request=l,this.onDidFilesChange=d,this.onLogMessage=c,this.verboseLogging=m,this.throttledFileChangesEmitter=this._register(new O.ThrottledWorker({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},y=>this.onDidFilesChange(y))),this.fileChangesAggregator=this._register(new O.RunOnceWorker(y=>this.handleFileChanges(y),h.FILE_CHANGES_HANDLER_DELAY)),this.excludes=(0,g.parseWatcherPatterns)(this.request.path,this.request.excludes),this.includes=this.request.includes?(0,g.parseWatcherPatterns)(this.request.path,this.request.includes):void 0,this.cts=new A.CancellationTokenSource,this.ready=this.watch()}async watch(){try{const l=await this.normalizePath(this.request);if(this.cts.token.isCancellationRequested)return;const d=await p.Promises.stat(l);this._register(await this.doWatch(l,d.isDirectory()))}catch(l){l.code!=="ENOENT"?this.error(l):this.trace(l)}}async normalizePath(l){let d=l.path;try{d=await p.Promises.realpath(l.path),l.path===d&&(d=await(0,P.realcase)(l.path)??l.path),l.path!==d&&this.trace(`correcting a path to watch that seems to be a symbolic link or wrong casing (original: ${l.path}, real: ${d})`)}catch{}return d}async doWatch(l,d){if(S.isMacintosh&&(0,_.isEqualOrParent)(l,"/Volumes/",!0))return this.error(`Refusing to watch ${l} for changes using fs.watch() for possibly being a network share where watching is unreliable and unstable.`),k.Disposable.None;const c=new A.CancellationTokenSource(this.cts.token),m=new k.DisposableStore;try{const y=(0,b.basename)(l),T=(0,I.watch)(l);m.add((0,k.toDisposable)(()=>{T.removeAllListeners(),T.close()})),this.trace(`Started watching: '${l}'`);const t=new Set;if(d)try{for(const n of await p.Promises.readdir(l))t.add(n)}catch(n){this.error(n)}const o=new Map;m.add((0,k.toDisposable)(()=>{for(const[,n]of o)n.dispose();o.clear()})),T.on("error",(n,s)=>{this.error(`Failed to watch ${l} for changes using fs.watch() (${n}, ${s})`),this.dispose()}),T.on("change",(n,s)=>{if(c.token.isCancellationRequested)return;this.trace(`[raw] ["${n}"] ${s}`);let i="";if(s&&(i=s.toString(),S.isMacintosh&&(i=(0,D.normalizeNFC)(i))),!(!i||n!=="change"&&n!=="rename"))if(d)if(n==="rename"){o.get(i)?.dispose();const r=setTimeout(async()=>{if(o.delete(i),i===y&&!await p.Promises.exists(l)){this.warn("Watcher shutdown because watched path got deleted"),this.dispose();return}const a=await this.existsChildStrictCase((0,b.join)(l,i));if(c.token.isCancellationRequested)return;let E;a?t.has(i)?E=0:(E=1,t.add(i)):(t.delete(i),E=2),this.onFileChange({path:(0,b.join)(this.request.path,i),type:E})},h.FILE_DELETE_HANDLER_DELAY);o.set(i,(0,k.toDisposable)(()=>clearTimeout(r)))}else{let r;t.has(i)?r=0:(r=1,t.add(i)),this.onFileChange({path:(0,b.join)(this.request.path,i),type:r})}else if(n==="rename"||i!==y){const r=setTimeout(async()=>{const a=await p.Promises.exists(l);c.token.isCancellationRequested||(a?(this.onFileChange({path:this.request.path,type:0},!0),m.add(await this.doWatch(l,!1))):(this.onFileChange({path:this.request.path,type:2},!0),this.fileChangesAggregator.flush(),this.dispose()))},h.FILE_DELETE_HANDLER_DELAY);m.clear(),m.add((0,k.toDisposable)(()=>clearTimeout(r)))}else this.onFileChange({path:this.request.path,type:0},!0)})}catch(y){await p.Promises.exists(l)&&!c.token.isCancellationRequested&&this.error(`Failed to watch ${l} for changes using fs.watch() (${y.toString()})`)}return(0,k.toDisposable)(()=>{c.dispose(!0),m.dispose()})}onFileChange(l,d=!1){this.cts.token.isCancellationRequested||(this.verboseLogging&&this.trace(`${l.type===1?"[ADDED]":l.type===2?"[DELETED]":"[CHANGED]"} ${l.path}`),!d&&this.excludes.some(c=>c(l.path))?this.verboseLogging&&this.trace(` >> ignored (excluded) ${l.path}`):!d&&this.includes&&this.includes.length>0&&!this.includes.some(c=>c(l.path))?this.verboseLogging&&this.trace(` >> ignored (not included) ${l.path}`):this.fileChangesAggregator.work(l))}handleFileChanges(l){const d=(0,g.coalesceEvents)(l);if(d.length>0){if(this.verboseLogging)for(const m of d)this.trace(`>> normalized ${m.type===1?"[ADDED]":m.type===2?"[DELETED]":"[CHANGED]"} ${m.path}`);this.throttledFileChangesEmitter.work(d)?this.throttledFileChangesEmitter.pending>0&&this.trace(`started throttling events due to large amount of file change events at once (pending: ${this.throttledFileChangesEmitter.pending}, most recent change: ${d[0].path}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`):this.warn(`started ignoring events due to too many file change events at once (incoming: ${d.length}, most recent change: ${d[0].path}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}}async existsChildStrictCase(l){if(S.isLinux)return p.Promises.exists(l);try{const d=(0,b.basename)(l);return(await p.Promises.readdir((0,b.dirname)(l))).some(m=>m===d)}catch(d){return this.trace(d),!1}}setVerboseLogging(l){this.verboseLogging=l}error(l){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"error",message:`[File Watcher (node.js)] ${l}`})}warn(l){this.cts.token.isCancellationRequested||this.onLogMessage?.({type:"warn",message:`[File Watcher (node.js)] ${l}`})}trace(l){!this.cts.token.isCancellationRequested&&this.verboseLogging&&this.onLogMessage?.({type:"trace",message:`[File Watcher (node.js)] ${l}`})}dispose(){this.trace(`stopping file watcher on ${this.request.path}`),this.cts.dispose(!0),super.dispose()}}e.NodeJSFileWatcherLibrary=h;async function f(w,l,d,c,m=512){const y=await p.Promises.open(w,"r"),T=Buffer.allocUnsafe(m),t=new A.CancellationTokenSource(c);let o,n=!1;const s={path:w,excludes:[],recursive:!1},i=new h(s,r=>{(async()=>{for(const{type:a}of r)if(a===0){if(n)return;n=!0;try{for(;!t.token.isCancellationRequested;){const{bytesRead:E}=await p.Promises.read(y,T,0,m,null);if(!E||t.token.isCancellationRequested)break;l(T.slice(0,E))}}catch(E){o=new Error(E),t.dispose(!0)}finally{n=!1}}})()});return await i.ready,d(),new Promise((r,a)=>{t.token.onCancellationRequested(async()=>{i.dispose();try{await p.Promises.close(y)}catch(E){o=new Error(E)}o?a(o):r()})})}e.watchFileContents=f}),define(ce[192],le([0,1,3,93,2,6,191]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeJSWatcher=void 0;class D extends A.Disposable{constructor(){super(...arguments),this._onDidChangeFile=this._register(new I.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidLogMessage=this._register(new I.Emitter),this.onDidLogMessage=this._onDidLogMessage.event,this.onDidError=I.Event.None,this.watchers=new Map,this.verboseLogging=!1}async watch(S){const P=this.normalizeRequests(S),p=P.filter(h=>{const f=this.watchers.get(h.path);return f?!(0,O.patternsEquals)(f.request.excludes,h.excludes)||!(0,O.patternsEquals)(f.request.includes,h.includes):!0}),g=Array.from(this.watchers.values()).filter(({request:h})=>!P.find(f=>f.path===h.path&&(0,O.patternsEquals)(f.excludes,h.excludes)&&(0,O.patternsEquals)(f.includes,h.includes))).map(({request:h})=>h.path);p.length&&this.trace(`Request to start watching: ${p.map(h=>`${h.path} (excludes: ${h.excludes.length>0?h.excludes:"<none>"}, includes: ${h.includes&&h.includes.length>0?JSON.stringify(h.includes):"<all>"})`).join(",")}`),g.length&&this.trace(`Request to stop watching: ${g.join(",")}`);for(const h of g)this.stopWatching(h);for(const h of p)this.startWatching(h)}startWatching(S){const P=new k.NodeJSFileWatcherLibrary(S,g=>this._onDidChangeFile.fire(g),g=>this._onDidLogMessage.fire(g),this.verboseLogging),p={request:S,instance:P};this.watchers.set(S.path,p)}async stop(){for(const[S]of this.watchers)this.stopWatching(S);this.watchers.clear()}stopWatching(S){const P=this.watchers.get(S);P&&(this.watchers.delete(S),P.instance.dispose())}normalizeRequests(S){const P=new Map;for(const p of S){const g=_.isLinux?p.path:p.path.toLowerCase();P.set(g,p)}return Array.from(P.values())}async setVerboseLogging(S){this.verboseLogging=S;for(const[,P]of this.watchers)P.instance.setVerboseLogging(S)}trace(S){this.verboseLogging&&this._onDidLogMessage.fire({type:"trace",message:this.toMessage(S)})}toMessage(S,P){return P?`[File Watcher (node.js)] ${S} (path: ${P.request.path})`:`[File Watcher (node.js)] ${S}`}}e.NodeJSWatcher=D}),define(ce[193],le([0,1,54,192]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeJSWatcherClient=void 0;class A extends I.AbstractNonRecursiveWatcherClient{constructor(k,D,b){super(k,D,b),this.init()}createWatcher(){return new O.NodeJSWatcher}}e.NodeJSWatcherClient=A}),define(ce[194],le([0,1,26,44,95,54]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UniversalWatcherClient=void 0;class k extends _.AbstractUniversalWatcherClient{constructor(b,S,P){super(b,S,P),this.init()}createWatcher(b){const S=b.add(new A.Client(I.FileAccess.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_AMD_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return b.add(S.onDidProcessExit(({code:P,signal:p})=>this.onError(`terminated by itself with code ${P}, signal: ${p}`))),O.ProxyChannel.toService((0,O.getNextTickChannel)(S.getChannel("watcher")))}}e.UniversalWatcherClient=k}),define(ce[69],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceCollection=void 0;class I{constructor(...A){this._entries=new Map;for(const[_,k]of A)this.set(_,k)}set(A,_){const k=this._entries.get(A);return this._entries.set(A,_),k}has(A){return this._entries.has(A)}get(A){return this._entries.get(A)}}e.ServiceCollection=I}),define(ce[195],le([0,1,5,8,2,67,186,4,69,87]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Trace=e.InstantiationService=void 0;const P=!1;class p extends Error{constructor(l){super("cyclic dependency between services"),this.message=l.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
${l.toString()}`}}class g{constructor(l=new b.ServiceCollection,d=!1,c,m=P){this._services=l,this._strict=d,this._parent=c,this._enableTracing=m,this._activeInstantiations=new Set,this._services.set(D.IInstantiationService,this),this._globalGraph=m?c?._globalGraph??new k.Graph(y=>y):void 0}createChild(l){return new g(l,this._strict,this,this._enableTracing)}invokeFunction(l,...d){const c=f.traceInvocation(this._enableTracing,l);let m=!1;try{return l({get:T=>{if(m)throw(0,O.illegalState)("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(T,c);if(!t)throw new Error(`[invokeFunction] unknown service '${T}'`);return t}},...d)}finally{m=!0,c.stop()}}createInstance(l,...d){let c,m;return l instanceof _.SyncDescriptor?(c=f.traceCreation(this._enableTracing,l.ctor),m=this._createInstance(l.ctor,l.staticArguments.concat(d),c)):(c=f.traceCreation(this._enableTracing,l),m=this._createInstance(l,d,c)),c.stop(),m}_createInstance(l,d=[],c){const m=D._util.getServiceDependencies(l).sort((t,o)=>t.index-o.index),y=[];for(const t of m){const o=this._getOrCreateServiceInstance(t.id,c);o||this._throwIfStrict(`[createInstance] ${l.name} depends on UNKNOWN service ${t.id}.`,!1),y.push(o)}const T=m.length>0?m[0].index:d.length;if(d.length!==T){console.trace(`[createInstance] First service dependency of ${l.name} at position ${T+1} conflicts with ${d.length} static arguments`);const t=T-d.length;t>0?d=d.concat(new Array(t)):d=d.slice(0,T)}return Reflect.construct(l,d.concat(y))}_setServiceInstance(l,d){if(this._services.get(l)instanceof _.SyncDescriptor)this._services.set(l,d);else if(this._parent)this._parent._setServiceInstance(l,d);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(l){const d=this._services.get(l);return!d&&this._parent?this._parent._getServiceInstanceOrDescriptor(l):d}_getOrCreateServiceInstance(l,d){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(l));const c=this._getServiceInstanceOrDescriptor(l);return c instanceof _.SyncDescriptor?this._safeCreateAndCacheServiceInstance(l,c,d.branch(l,!0)):(d.branch(l,!1),c)}_safeCreateAndCacheServiceInstance(l,d,c){if(this._activeInstantiations.has(l))throw new Error(`illegal state - RECURSIVELY instantiating service '${l}'`);this._activeInstantiations.add(l);try{return this._createAndCacheServiceInstance(l,d,c)}finally{this._activeInstantiations.delete(l)}}_createAndCacheServiceInstance(l,d,c){const m=new k.Graph(t=>t.id.toString());let y=0;const T=[{id:l,desc:d,_trace:c}];for(;T.length;){const t=T.pop();if(m.lookupOrInsertNode(t),y++>1e3)throw new p(m);for(const o of D._util.getServiceDependencies(t.desc.ctor)){const n=this._getServiceInstanceOrDescriptor(o.id);if(n||this._throwIfStrict(`[createInstance] ${l} depends on ${o.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(o.id)),n instanceof _.SyncDescriptor){const s={id:o.id,desc:n,_trace:t._trace.branch(o.id,!0)};m.insertEdge(t,s),T.push(s)}}}for(;;){const t=m.roots();if(t.length===0){if(!m.isEmpty())throw new p(m);break}for(const{data:o}of t){if(this._getServiceInstanceOrDescriptor(o.id)instanceof _.SyncDescriptor){const s=this._createServiceInstanceWithOwner(o.id,o.desc.ctor,o.desc.staticArguments,o.desc.supportsDelayedInstantiation,o._trace);this._setServiceInstance(o.id,s)}m.removeNode(o)}}return this._getServiceInstanceOrDescriptor(l)}_createServiceInstanceWithOwner(l,d,c=[],m,y){if(this._services.get(l)instanceof _.SyncDescriptor)return this._createServiceInstance(l,d,c,m,y);if(this._parent)return this._parent._createServiceInstanceWithOwner(l,d,c,m,y);throw new Error(`illegalState - creating UNKNOWN service instance ${d.name}`)}_createServiceInstance(l,d,c=[],m,y){if(m){const T=new g(void 0,this._strict,this,this._enableTracing);T._globalGraphImplicitDependency=String(l);const t=new Map,o=new I.IdleValue(()=>{const n=T._createInstance(d,c,y);for(const[s,i]of t){const r=n[s];if(typeof r=="function")for(const a of i)r.apply(n,a)}return t.clear(),n});return new Proxy(Object.create(null),{get(n,s){if(!o.isInitialized&&typeof s=="string"&&(s.startsWith("onDid")||s.startsWith("onWill"))){let a=t.get(s);return a||(a=new S.LinkedList,t.set(s,a)),(v,u,C)=>{const U=a.push([v,u,C]);return(0,A.toDisposable)(U)}}if(s in n)return n[s];const i=o.value;let r=i[s];return typeof r!="function"||(r=r.bind(i),n[s]=r),r},set(n,s,i){return o.value[s]=i,!0},getPrototypeOf(n){return d.prototype}})}else return this._createInstance(d,c,y)}_throwIfStrict(l,d){if(d&&console.warn(l),this._strict)throw new Error(l)}}e.InstantiationService=g;var h;(function(w){w[w.None=0]="None",w[w.Creation=1]="Creation",w[w.Invocation=2]="Invocation",w[w.Branch=3]="Branch"})(h||(h={}));class f{static{this.all=new Set}static{this._None=new class extends f{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(l,d){return l?new f(2,d.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):f._None}static traceCreation(l,d){return l?new f(1,d.name):f._None}static{this._totals=0}constructor(l,d){this.type=l,this.name=d,this._start=Date.now(),this._dep=[]}branch(l,d){const c=new f(3,l.toString());return this._dep.push([l,d,c]),c}stop(){const l=Date.now()-this._start;f._totals+=l;let d=!1;function c(y,T){const t=[],o=new Array(y+1).join("	");for(const[n,s,i]of T._dep)if(s&&i){d=!0,t.push(`${o}CREATES -> ${n}`);const r=c(y+1,i);r&&t.push(r)}else t.push(`${o}uses -> ${n}`);return t.join(`
`)}const m=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${c(1,this)}`,`DONE, took ${l.toFixed(2)}ms (grand total ${f._totals.toFixed(2)}ms)`];(l>2||d)&&f.all.add(m.join(`
`))}}e.Trace=f}),define(ce[70],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MainProcessService=e.IMainProcessService=void 0,e.IMainProcessService=(0,I.createDecorator)("mainProcessService");class O{constructor(_,k){this.server=_,this.router=k}getChannel(_){return this.server.getChannel(_,this.router)}registerChannel(_,k){this.server.registerChannel(_,k)}}e.MainProcessService=O}),define(ce[71],le([0,1,25,2,6,163,29,4]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LanguagePackBaseService=e.ILanguagePackService=e.getLocale=void 0;function b(P){return P.tags.find(p=>p.startsWith("lp-"))?.split("lp-")[1]}e.getLocale=b,e.ILanguagePackService=(0,D.createDecorator)("languagePackService");let S=class extends O.Disposable{constructor(p){super(),this.extensionGalleryService=p}async getAvailableLanguages(){const p=new I.CancellationTokenSource;setTimeout(()=>p.cancel(),1e3);let g;try{g=await this.extensionGalleryService.query({text:'category:"language packs"',pageSize:20},p.token)}catch{return[]}const f=g.firstPage.filter(w=>w.properties.localizedLanguages?.length&&w.tags.some(l=>l.startsWith("lp-"))).map(w=>{const l=w.properties.localizedLanguages?.[0],d=b(w);return{...this.createQuickPickItem(d,l,w),extensionId:w.identifier.id,galleryExtension:w}});return f.push(this.createQuickPickItem("en","English")),f}createQuickPickItem(p,g,h){const f=g??p;let w;if(f!==p&&(w=`(${p})`),p.toLowerCase()===A.language.toLowerCase()&&(w??="",w+=(0,_.localize)(0,null)),h?.installCount){w??="";const l=h.installCount;let d;l>1e6?d=`${Math.floor(l/1e5)/10}M`:l>1e3?d=`${Math.floor(l/1e3)}K`:d=String(l),w+=` $(cloud-download) ${d}`}return{id:p,label:f,description:w}}};e.LanguagePackBaseService=S,e.LanguagePackBaseService=S=Ee([G(0,k.IExtensionGalleryService)],S)}),define(ce[196],le([0,1,2,71]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LocalizationsUpdater=void 0;let A=class extends I.Disposable{constructor(k){super(),this.localizationsService=k,this.updateLocalizations()}updateLocalizations(){this.localizationsService.update()}};e.LocalizationsUpdater=A,e.LocalizationsUpdater=A=Ee([G(0,O.ILanguagePackService)],A)}),define(ce[7],le([0,1,38,3,51,2,35,6,22,12,11,96,4]),function(te,e,I,O,A,_,k,D,b,S,P,p,g){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONTEXT_LOG_LEVEL=e.parseLogLevel=e.LogLevelToString=e.getLogLevel=e.NullLogService=e.NullLogger=e.AbstractLoggerService=e.MultiplexLogger=e.AdapterLogger=e.ConsoleLogger=e.ConsoleMainLogger=e.AbstractMessageLogger=e.AbstractLogger=e.log=e.DEFAULT_LOG_LEVEL=e.LogLevel=e.isLogLevel=e.ILoggerService=e.ILogService=void 0,e.ILogService=(0,g.createDecorator)("logService"),e.ILoggerService=(0,g.createDecorator)("loggerService");function h(){return new Date().toISOString()}function f(v){return(0,S.isNumber)(v)}e.isLogLevel=f;var w;(function(v){v[v.Off=0]="Off",v[v.Trace=1]="Trace",v[v.Debug=2]="Debug",v[v.Info=3]="Info",v[v.Warning=4]="Warning",v[v.Error=5]="Error"})(w||(e.LogLevel=w={})),e.DEFAULT_LOG_LEVEL=w.Info;function l(v,u,C){switch(u){case w.Trace:v.trace(C);break;case w.Debug:v.debug(C);break;case w.Info:v.info(C);break;case w.Warning:v.warn(C);break;case w.Error:v.error(C);break;case w.Off:break;default:throw new Error(`Invalid log level ${u}`)}}e.log=l;function d(v,u=!1){let C="";for(let U=0;U<v.length;U++){let F=v[U];if(F instanceof Error&&(F=(0,I.toErrorMessage)(F,u)),typeof F=="object")try{F=JSON.stringify(F)}catch{}C+=(U>0?" ":"")+F}return C}class c extends _.Disposable{constructor(){super(...arguments),this.level=e.DEFAULT_LOG_LEVEL,this._onDidChangeLogLevel=this._register(new O.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(u){this.level!==u&&(this.level=u,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(u){return this.level!==w.Off&&this.level<=u}}e.AbstractLogger=c;class m extends c{constructor(u){super(),this.logAlways=u}checkLogLevel(u){return this.logAlways||super.checkLogLevel(u)}trace(u,...C){this.checkLogLevel(w.Trace)&&this.log(w.Trace,d([u,...C],!0))}debug(u,...C){this.checkLogLevel(w.Debug)&&this.log(w.Debug,d([u,...C]))}info(u,...C){this.checkLogLevel(w.Info)&&this.log(w.Info,d([u,...C]))}warn(u,...C){this.checkLogLevel(w.Warning)&&this.log(w.Warning,d([u,...C]))}error(u,...C){if(this.checkLogLevel(w.Error))if(u instanceof Error){const U=Array.prototype.slice.call(arguments);U[0]=u.stack,this.log(w.Error,d(U))}else this.log(w.Error,d([u,...C]))}flush(){}}e.AbstractMessageLogger=m;class y extends c{constructor(u=e.DEFAULT_LOG_LEVEL){super(),this.setLevel(u),this.useColors=!D.isWindows}trace(u,...C){this.checkLogLevel(w.Trace)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,u,...C):console.log(`[main ${h()}]`,u,...C))}debug(u,...C){this.checkLogLevel(w.Debug)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,u,...C):console.log(`[main ${h()}]`,u,...C))}info(u,...C){this.checkLogLevel(w.Info)&&(this.useColors?console.log(`\x1B[90m[main ${h()}]\x1B[0m`,u,...C):console.log(`[main ${h()}]`,u,...C))}warn(u,...C){this.checkLogLevel(w.Warning)&&(this.useColors?console.warn(`\x1B[93m[main ${h()}]\x1B[0m`,u,...C):console.warn(`[main ${h()}]`,u,...C))}error(u,...C){this.checkLogLevel(w.Error)&&(this.useColors?console.error(`\x1B[91m[main ${h()}]\x1B[0m`,u,...C):console.error(`[main ${h()}]`,u,...C))}dispose(){}flush(){}}e.ConsoleMainLogger=y;class T extends c{constructor(u=e.DEFAULT_LOG_LEVEL,C=!0){super(),this.useColors=C,this.setLevel(u)}trace(u,...C){this.checkLogLevel(w.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",u,...C):console.log(u,...C))}debug(u,...C){this.checkLogLevel(w.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",u,...C):console.log(u,...C))}info(u,...C){this.checkLogLevel(w.Info)&&(this.useColors?console.log("%c INFO","color: #33f",u,...C):console.log(u,...C))}warn(u,...C){this.checkLogLevel(w.Warning)&&(this.useColors?console.log("%c WARN","color: #993",u,...C):console.log(u,...C))}error(u,...C){this.checkLogLevel(w.Error)&&(this.useColors?console.log("%c  ERR","color: #f33",u,...C):console.error(u,...C))}dispose(){}flush(){}}e.ConsoleLogger=T;class t extends c{constructor(u,C=e.DEFAULT_LOG_LEVEL){super(),this.adapter=u,this.setLevel(C)}trace(u,...C){this.checkLogLevel(w.Trace)&&this.adapter.log(w.Trace,[this.extractMessage(u),...C])}debug(u,...C){this.checkLogLevel(w.Debug)&&this.adapter.log(w.Debug,[this.extractMessage(u),...C])}info(u,...C){this.checkLogLevel(w.Info)&&this.adapter.log(w.Info,[this.extractMessage(u),...C])}warn(u,...C){this.checkLogLevel(w.Warning)&&this.adapter.log(w.Warning,[this.extractMessage(u),...C])}error(u,...C){this.checkLogLevel(w.Error)&&this.adapter.log(w.Error,[this.extractMessage(u),...C])}extractMessage(u){return typeof u=="string"?u:(0,I.toErrorMessage)(u,this.checkLogLevel(w.Trace))}dispose(){}flush(){}}e.AdapterLogger=t;class o extends c{constructor(u){super(),this.loggers=u,u.length&&this.setLevel(u[0].getLevel())}setLevel(u){for(const C of this.loggers)C.setLevel(u);super.setLevel(u)}trace(u,...C){for(const U of this.loggers)U.trace(u,...C)}debug(u,...C){for(const U of this.loggers)U.debug(u,...C)}info(u,...C){for(const U of this.loggers)U.info(u,...C)}warn(u,...C){for(const U of this.loggers)U.warn(u,...C)}error(u,...C){for(const U of this.loggers)U.error(u,...C)}flush(){for(const u of this.loggers)u.flush()}dispose(){for(const u of this.loggers)u.dispose()}}e.MultiplexLogger=o;class n extends _.Disposable{constructor(u,C,U){if(super(),this.logLevel=u,this.logsHome=C,this._loggers=new k.ResourceMap,this._onDidChangeLoggers=this._register(new O.Emitter),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new O.Emitter),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new O.Emitter),this.onDidChangeVisibility=this._onDidChangeVisibility.event,U)for(const F of U)this._loggers.set(F.resource,{logger:void 0,info:F})}getLoggerEntry(u){return(0,S.isString)(u)?[...this._loggers.values()].find(C=>C.info.id===u):this._loggers.get(u)}getLogger(u){return this.getLoggerEntry(u)?.logger}createLogger(u,C){const U=this.toResource(u),F=(0,S.isString)(u)?u:C?.id??(0,A.hash)(U.toString()).toString(16);let M=this._loggers.get(U)?.logger;const z=C?.logLevel==="always"?w.Trace:C?.logLevel;M||(M=this.doCreateLogger(U,z??this.getLogLevel(U)??this.logLevel,{...C,id:F}));const V={logger:M,info:{resource:U,id:F,logLevel:z,name:C?.name,hidden:C?.hidden,extensionId:C?.extensionId,when:C?.when}};return this.registerLogger(V.info),this._loggers.set(U,V),M}toResource(u){return(0,S.isString)(u)?(0,b.joinPath)(this.logsHome,`${u}.log`):u}setLogLevel(u,C){if(P.URI.isUri(u)){const U=u,F=C,M=this._loggers.get(U);M&&F!==M.info.logLevel&&(M.info.logLevel=F===this.logLevel?void 0:F,M.logger?.setLevel(F),this._loggers.set(M.info.resource,M),this._onDidChangeLogLevel.fire([U,F]))}else{this.logLevel=u;for(const[U,F]of this._loggers.entries())this._loggers.get(U)?.info.logLevel===void 0&&F.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(u,C){const U=this.getLoggerEntry(u);U&&C!==!U.info.hidden&&(U.info.hidden=!C,this._loggers.set(U.info.resource,U),this._onDidChangeVisibility.fire([U.info.resource,C]))}getLogLevel(u){let C;return u&&(C=this._loggers.get(u)?.info.logLevel),C??this.logLevel}registerLogger(u){const C=this._loggers.get(u.resource);C?C.info.hidden!==u.hidden&&this.setVisibility(u.resource,!u.hidden):(this._loggers.set(u.resource,{info:u,logger:void 0}),this._onDidChangeLoggers.fire({added:[u],removed:[]}))}deregisterLogger(u){const C=this._loggers.get(u);C&&(C.logger&&C.logger.dispose(),this._loggers.delete(u),this._onDidChangeLoggers.fire({added:[],removed:[C.info]}))}*getRegisteredLoggers(){for(const u of this._loggers.values())yield u.info}getRegisteredLogger(u){return this._loggers.get(u)?.info}dispose(){this._loggers.forEach(u=>u.logger?.dispose()),this._loggers.clear(),super.dispose()}}e.AbstractLoggerService=n;class s{constructor(){this.onDidChangeLogLevel=new O.Emitter().event}setLevel(u){}getLevel(){return w.Info}trace(u,...C){}debug(u,...C){}info(u,...C){}warn(u,...C){}error(u,...C){}critical(u,...C){}dispose(){}flush(){}}e.NullLogger=s;class i extends s{}e.NullLogService=i;function r(v){if(v.verbose)return w.Trace;if(typeof v.logLevel=="string"){const u=E(v.logLevel.toLowerCase());if(u!==void 0)return u}return e.DEFAULT_LOG_LEVEL}e.getLogLevel=r;function a(v){switch(v){case w.Trace:return"trace";case w.Debug:return"debug";case w.Info:return"info";case w.Warning:return"warn";case w.Error:return"error";case w.Off:return"off"}}e.LogLevelToString=a;function E(v){switch(v){case"trace":return w.Trace;case"debug":return w.Debug;case"info":return w.Info;case"warn":return w.Warning;case"error":return w.Error;case"critical":return w.Error;case"off":return w.Off}}e.parseLogLevel=E,e.CONTEXT_LOG_LEVEL=new p.RawContextKey("logLevel",a(w.Info))}),define(ce[197],le([0,1,5,8,2,22,31,15,7]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogsDataCleaner=void 0;let S=class extends A.Disposable{constructor(p,g){super(),this.environmentService=p,this.logService=g,this._register(new I.RunOnceScheduler(()=>{this.cleanUpOldLogs()},10*1e3)).schedule()}async cleanUpOldLogs(){this.logService.trace("[logs cleanup]: Starting to clean up old logs.");try{const p=(0,_.basename)(this.environmentService.logsHome),g=(0,_.dirname)(this.environmentService.logsHome),w=(await k.Promises.readdir(g.fsPath)).filter(d=>/^\d{8}T\d{6}$/.test(d)).sort().filter(d=>d!==p),l=w.slice(0,Math.max(0,w.length-9));l.length>0&&(this.logService.trace(`[logs cleanup]: Removing log folders '${l.join(", ")}'`),await Promise.all(l.map(d=>k.Promises.rm((0,_.joinPath)(g,d).fsPath))))}catch(p){(0,O.onUnexpectedError)(p)}}};e.LogsDataCleaner=S,e.LogsDataCleaner=S=Ee([G(0,D.IEnvironmentService),G(1,b.ILogService)],S)}),define(ce[198],le([0,1,20,5,8,3,2,16,54,7]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDiskFileSystemProvider=void 0;class P extends k.Disposable{constructor(g,h){super(),this.logService=g,this.options=h,this._onDidChangeFile=this._register(new _.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this._onDidWatchError=this._register(new _.Emitter),this.onDidWatchError=this._onDidWatchError.event,this.universalPathsToWatch=[],this.universalWatchRequestDelayer=this._register(new O.ThrottledDelayer(0)),this.nonRecursivePathsToWatch=[],this.nonRecursiveWatchRequestDelayer=this._register(new O.ThrottledDelayer(0))}watch(g,h){return h.recursive||this.options?.watcher?.forceUniversal?this.watchUniversal(g,h):this.watchNonRecursive(g,h)}watchUniversal(g,h){const f={path:this.toFilePath(g),excludes:h.excludes,includes:h.includes,recursive:h.recursive},w=(0,I.insert)(this.universalPathsToWatch,f);return this.refreshUniversalWatchers(),(0,k.toDisposable)(()=>{w(),this.refreshUniversalWatchers()})}refreshUniversalWatchers(){this.universalWatchRequestDelayer.trigger(()=>this.doRefreshUniversalWatchers()).catch(g=>(0,A.onUnexpectedError)(g))}doRefreshUniversalWatchers(){this.universalWatcher||(this.universalWatcher=this._register(this.createUniversalWatcher(h=>this._onDidChangeFile.fire((0,b.toFileChanges)(h)),h=>this.onWatcherLogMessage(h),this.logService.getLevel()===S.LogLevel.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.universalWatcher?.setVerboseLogging(this.logService.getLevel()===S.LogLevel.Trace)})));const g=this.options?.watcher?.recursive?.usePolling;if(g===!0)for(const h of this.universalPathsToWatch)(0,b.isRecursiveWatchRequest)(h)&&(h.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3);else if(Array.isArray(g))for(const h of this.universalPathsToWatch)(0,b.isRecursiveWatchRequest)(h)&&g.includes(h.path)&&(h.pollingInterval=this.options?.watcher?.recursive?.pollingInterval??5e3);return this.universalWatcher.watch(this.universalPathsToWatch)}watchNonRecursive(g,h){const f={path:this.toFilePath(g),excludes:h.excludes,includes:h.includes,recursive:!1},w=(0,I.insert)(this.nonRecursivePathsToWatch,f);return this.refreshNonRecursiveWatchers(),(0,k.toDisposable)(()=>{w(),this.refreshNonRecursiveWatchers()})}refreshNonRecursiveWatchers(){this.nonRecursiveWatchRequestDelayer.trigger(()=>this.doRefreshNonRecursiveWatchers()).catch(g=>(0,A.onUnexpectedError)(g))}doRefreshNonRecursiveWatchers(){return this.nonRecursiveWatcher||(this.nonRecursiveWatcher=this._register(this.createNonRecursiveWatcher(g=>this._onDidChangeFile.fire((0,b.toFileChanges)(g)),g=>this.onWatcherLogMessage(g),this.logService.getLevel()===S.LogLevel.Trace)),this._register(this.logService.onDidChangeLogLevel(()=>{this.nonRecursiveWatcher?.setVerboseLogging(this.logService.getLevel()===S.LogLevel.Trace)}))),this.nonRecursiveWatcher.watch(this.nonRecursivePathsToWatch)}onWatcherLogMessage(g){g.type==="error"&&this._onDidWatchError.fire(g.message),this.logService[g.type](g.message)}toFilePath(g){return(0,D.normalize)(g.fsPath)}}e.AbstractDiskFileSystemProvider=P}),define(ce[199],le([0,1,20,5,14,25,3,51,59,2,47,26,102,22,43,159,13,101,7,8]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileService=void 0;let y=class extends S.Disposable{constructor(t){super(),this.logService=t,this.BUFFER_SIZE=256*1024,this._onDidChangeFileSystemProviderRegistrations=this._register(new k.Emitter),this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=this._register(new k.Emitter),this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=this._register(new k.Emitter),this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.provider=new Map,this._onDidRunOperation=this._register(new k.Emitter),this.onDidRunOperation=this._onDidRunOperation.event,this._onDidFilesChange=this._register(new k.Emitter),this.onDidFilesChange=this._onDidFilesChange.event,this._onDidWatchError=this._register(new k.Emitter),this.onDidWatchError=this._onDidWatchError.event,this.activeWatchers=new Map,this.writeQueue=this._register(new O.ResourceQueue)}registerProvider(t,o){if(this.provider.has(t))throw new Error(`A filesystem provider for the scheme '${t}' is already registered.`);(0,g.mark)(`code/registerFilesystem/${t}`);const n=new S.DisposableStore;return this.provider.set(t,o),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:t,provider:o}),n.add(o.onDidChangeFile(s=>this._onDidFilesChange.fire(new l.FileChangesEvent(s,!this.isPathCaseSensitive(o))))),typeof o.onDidWatchError=="function"&&n.add(o.onDidWatchError(s=>this._onDidWatchError.fire(new Error(s)))),n.add(o.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:o,scheme:t}))),(0,S.toDisposable)(()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:t,provider:o}),this.provider.delete(t),(0,S.dispose)(n)})}getProvider(t){return this.provider.get(t)}async activateProvider(t){const o=[];this._onWillActivateFileSystemProvider.fire({scheme:t,join(n){o.push(n)}}),!this.provider.has(t)&&await O.Promises.settled(o)}async canHandleResource(t){return await this.activateProvider(t.scheme),this.hasProvider(t)}hasProvider(t){return this.provider.has(t.scheme)}hasCapability(t,o){const n=this.provider.get(t.scheme);return!!(n&&n.capabilities&o)}listCapabilities(){return b.Iterable.map(this.provider,([t,o])=>({scheme:t,capabilities:o.capabilities}))}async withProvider(t){if(!(0,h.isAbsolutePath)(t))throw new l.FileOperationError((0,w.localize)(0,null,this.resourceForError(t)),8);await this.activateProvider(t.scheme);const o=this.provider.get(t.scheme);if(!o){const n=new m.ErrorNoTelemetry;throw n.message=(0,w.localize)(1,null,t.toString()),n}return o}async withReadProvider(t){const o=await this.withProvider(t);if((0,l.hasOpenReadWriteCloseCapability)(o)||(0,l.hasReadWriteCapability)(o)||(0,l.hasFileReadStreamCapability)(o))return o;throw new Error(`Filesystem provider for scheme '${t.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async withWriteProvider(t){const o=await this.withProvider(t);if((0,l.hasOpenReadWriteCloseCapability)(o)||(0,l.hasReadWriteCapability)(o))return o;throw new Error(`Filesystem provider for scheme '${t.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(t,o){try{return await this.doResolveFile(t,o)}catch(n){throw(0,l.toFileSystemProviderErrorCode)(n)===l.FileSystemProviderErrorCode.FileNotFound?new l.FileOperationError((0,w.localize)(2,null,this.resourceForError(t)),1):(0,l.ensureFileSystemProviderError)(n)}}async doResolveFile(t,o){const n=await this.withProvider(t),s=this.isPathCaseSensitive(n),i=o?.resolveTo,r=o?.resolveSingleChildDescendants,a=o?.resolveMetadata,E=await n.stat(t);let v;return this.toFileStat(n,t,E,void 0,!!a,(u,C)=>(v||(v=P.TernarySearchTree.forUris(()=>!s),v.set(t,!0),i&&v.fill(!0,i)),v.get(u.resource)||v.findSuperstr(u.resource.with({query:null,fragment:null}))?!0:u.isDirectory&&r?C===1:!1))}async toFileStat(t,o,n,s,i,r){const{providerExtUri:a}=this.getExtUri(t),E={resource:o,name:a.basename(o),isFile:(n.type&l.FileType.File)!==0,isDirectory:(n.type&l.FileType.Directory)!==0,isSymbolicLink:(n.type&l.FileType.SymbolicLink)!==0,mtime:n.mtime,ctime:n.ctime,size:n.size,readonly:!!((n.permissions??0)&l.FilePermission.Readonly)||!!(t.capabilities&2048),locked:!!((n.permissions??0)&l.FilePermission.Locked),etag:(0,l.etag)({mtime:n.mtime,size:n.size}),children:void 0};if(E.isDirectory&&r(E,s)){try{const v=await t.readdir(o),u=await O.Promises.settled(v.map(async([C,U])=>{try{const F=a.joinPath(o,C),M=i?await t.stat(F):{type:U};return await this.toFileStat(t,F,M,v.length,i,r)}catch(F){return this.logService.trace(F),null}}));E.children=(0,I.coalesce)(u)}catch(v){this.logService.trace(v),E.children=[]}return E}return E}async resolveAll(t){return O.Promises.settled(t.map(async o=>{try{return{stat:await this.doResolveFile(o.resource,o.options),success:!0}}catch(n){return this.logService.trace(n),{stat:void 0,success:!1}}}))}async stat(t){const o=await this.withProvider(t),n=await o.stat(t);return this.toFileStat(o,t,n,void 0,!0,()=>!1)}async exists(t){const o=await this.withProvider(t);try{return!!await o.stat(t)}catch{return!1}}async canCreateFile(t,o){try{await this.doValidateCreateFile(t,o)}catch(n){return n}return!0}async doValidateCreateFile(t,o){if(!o?.overwrite&&await this.exists(t))throw new l.FileOperationError((0,w.localize)(3,null,this.resourceForError(t)),3,o)}async createFile(t,o=A.VSBuffer.fromString(""),n){await this.doValidateCreateFile(t,n);const s=await this.writeFile(t,o);return this._onDidRunOperation.fire(new l.FileOperationEvent(t,0,s)),s}async writeFile(t,o,n){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),{providerExtUri:i}=this.getExtUri(s);try{await this.validateWriteFile(s,t,n)||await this.mkdirp(s,i.dirname(t));let a;if((0,l.hasReadWriteCapability)(s)&&!(o instanceof A.VSBuffer))if((0,f.isReadableStream)(o)){const E=await(0,f.peekStream)(o,3);E.ended?a=A.VSBuffer.concat(E.buffer):a=E}else a=(0,f.peekReadable)(o,E=>A.VSBuffer.concat(E),3);else a=o;if(!(0,l.hasOpenReadWriteCloseCapability)(s)||(0,l.hasReadWriteCapability)(s)&&a instanceof A.VSBuffer)await this.doWriteUnbuffered(s,t,n,a);else{const E=a instanceof A.VSBuffer?(0,A.bufferToReadable)(a):a;n?.atomic!==!1&&n?.atomic?.postfix?await this.doWriteBufferedAtomic(s,t,(0,h.joinPath)((0,h.dirname)(t),`${(0,h.basename)(t)}${n.atomic.postfix}`),n,E):await this.doWriteBuffered(s,t,n,E)}this._onDidRunOperation.fire(new l.FileOperationEvent(t,4))}catch(r){throw new l.FileOperationError((0,w.localize)(4,null,this.resourceForError(t),(0,l.ensureFileSystemProviderError)(r).toString()),(0,l.toFileOperationResult)(r),n)}return this.resolve(t,{resolveMetadata:!0})}async validateWriteFile(t,o,n){const s=!!n?.unlock;if(s&&!(t.capabilities&8192))throw new Error((0,w.localize)(5,null,this.resourceForError(o)));if(!!n?.atomic){if(!(t.capabilities&32768))throw new Error((0,w.localize)(6,null,this.resourceForError(o)));if(s)throw new Error((0,w.localize)(7,null,this.resourceForError(o)))}let r;try{r=await t.stat(o)}catch{return}if(r.type&l.FileType.Directory)throw new l.FileOperationError((0,w.localize)(8,null,this.resourceForError(o)),0,n);if(this.throwIfFileIsReadonly(o,r),typeof n?.mtime=="number"&&typeof n.etag=="string"&&n.etag!==l.ETAG_DISABLED&&typeof r.mtime=="number"&&typeof r.size=="number"&&n.mtime<r.mtime&&n.etag!==(0,l.etag)({mtime:n.mtime,size:r.size}))throw new l.FileOperationError((0,w.localize)(9,null),3,n);return r}async readFile(t,o,n){const s=await this.withReadProvider(t);return o?.atomic?this.doReadFileAtomic(s,t,o,n):this.doReadFile(s,t,o,n)}async doReadFileAtomic(t,o,n,s){return new Promise((i,r)=>{this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(async()=>{try{const a=await this.doReadFile(t,o,n,s);i(a)}catch(a){r(a)}})})}async doReadFile(t,o,n,s){const i=await this.doReadFileStream(t,o,{...n,preferUnbuffered:!0},s);return{...i,value:await(0,A.streamToBuffer)(i.value)}}async readFileStream(t,o,n){const s=await this.withReadProvider(t);return this.doReadFileStream(s,t,o,n)}async doReadFileStream(t,o,n,s){const i=new _.CancellationTokenSource(s),r=this.validateReadFile(o,n).then(E=>E,E=>{throw i.cancel(),E});let a;try{return typeof n?.etag=="string"&&n.etag!==l.ETAG_DISABLED&&await r,n?.atomic&&(0,l.hasFileAtomicReadCapability)(t)||!((0,l.hasOpenReadWriteCloseCapability)(t)||(0,l.hasFileReadStreamCapability)(t))||(0,l.hasReadWriteCapability)(t)&&n?.preferUnbuffered?a=this.readFileUnbuffered(t,o,n):(0,l.hasFileReadStreamCapability)(t)?a=this.readFileStreamed(t,o,i.token,n):a=this.readFileBuffered(t,o,i.token,n),{...await r,value:a}}catch(E){throw a&&await(0,f.consumeStream)(a),this.restoreReadError(E,o,n)}}restoreReadError(t,o,n){const s=(0,w.localize)(10,null,this.resourceForError(o),(0,l.ensureFileSystemProviderError)(t).toString());return t instanceof l.NotModifiedSinceFileOperationError?new l.NotModifiedSinceFileOperationError(s,t.stat,n):t instanceof l.TooLargeFileOperationError?new l.TooLargeFileOperationError(s,t.fileOperationResult,t.size,t.options):new l.FileOperationError(s,(0,l.toFileOperationResult)(t),n)}readFileStreamed(t,o,n,s=Object.create(null)){const i=t.readFileStream(o,s,n);return(0,f.transform)(i,{data:r=>r instanceof A.VSBuffer?r:A.VSBuffer.wrap(r),error:r=>this.restoreReadError(r,o,s)},r=>A.VSBuffer.concat(r))}readFileBuffered(t,o,n,s=Object.create(null)){const i=(0,A.newWriteableBufferStream)();return(0,d.readFileIntoStream)(t,o,i,r=>r,{...s,bufferSize:this.BUFFER_SIZE,errorTransformer:r=>this.restoreReadError(r,o,s)},n),i}readFileUnbuffered(t,o,n){const s=(0,f.newWriteableStream)(i=>A.VSBuffer.concat(i));return(async()=>{try{let i;n?.atomic&&(0,l.hasFileAtomicReadCapability)(t)?i=await t.readFile(o,{atomic:!0}):i=await t.readFile(o),typeof n?.position=="number"&&(i=i.slice(n.position)),typeof n?.length=="number"&&(i=i.slice(0,n.length)),this.validateReadFileLimits(o,i.byteLength,n),s.end(A.VSBuffer.wrap(i))}catch(i){s.error(i),s.end()}})(),s}async validateReadFile(t,o){const n=await this.resolve(t,{resolveMetadata:!0});if(n.isDirectory)throw new l.FileOperationError((0,w.localize)(11,null,this.resourceForError(t)),0,o);if(typeof o?.etag=="string"&&o.etag!==l.ETAG_DISABLED&&o.etag===n.etag)throw new l.NotModifiedSinceFileOperationError((0,w.localize)(12,null),n,o);return this.validateReadFileLimits(t,n.size,o),n}validateReadFileLimits(t,o,n){if(typeof n?.limits?.size=="number"&&o>n.limits.size)throw new l.TooLargeFileOperationError((0,w.localize)(13,null,this.resourceForError(t)),7,o,n)}async canMove(t,o,n){return this.doCanMoveCopy(t,o,"move",n)}async canCopy(t,o,n){return this.doCanMoveCopy(t,o,"copy",n)}async doCanMoveCopy(t,o,n,s){if(t.toString()!==o.toString())try{const i=n==="move"?this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t):await this.withReadProvider(t),r=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o);await this.doValidateMoveCopy(i,t,r,o,n,s)}catch(i){return i}return!0}async move(t,o,n){const s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(t),t),i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o),r=await this.doMoveCopy(s,t,i,o,"move",!!n),a=await this.resolve(o,{resolveMetadata:!0});return this._onDidRunOperation.fire(new l.FileOperationEvent(t,r==="move"?2:3,a)),a}async copy(t,o,n){const s=await this.withReadProvider(t),i=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o),r=await this.doMoveCopy(s,t,i,o,"copy",!!n),a=await this.resolve(o,{resolveMetadata:!0});return this._onDidRunOperation.fire(new l.FileOperationEvent(t,r==="copy"?3:2,a)),a}async doMoveCopy(t,o,n,s,i,r){if(o.toString()===s.toString())return i;const{exists:a,isSameResourceWithDifferentPathCase:E}=await this.doValidateMoveCopy(t,o,n,s,i,r);if(a&&!E&&r&&await this.del(s,{recursive:!0}),await this.mkdirp(n,this.getExtUri(n).providerExtUri.dirname(s)),i==="copy"){if(t===n&&(0,l.hasFileFolderCopyCapability)(t))await t.copy(o,s,{overwrite:r});else{const v=await this.resolve(o);v.isDirectory?await this.doCopyFolder(t,v,n,s):await this.doCopyFile(t,o,n,s)}return i}else return t===n?(await t.rename(o,s,{overwrite:r}),i):(await this.doMoveCopy(t,o,n,s,"copy",r),await this.del(o,{recursive:!0}),"copy")}async doCopyFile(t,o,n,s){if((0,l.hasOpenReadWriteCloseCapability)(t)&&(0,l.hasOpenReadWriteCloseCapability)(n))return this.doPipeBuffered(t,o,n,s);if((0,l.hasOpenReadWriteCloseCapability)(t)&&(0,l.hasReadWriteCapability)(n))return this.doPipeBufferedToUnbuffered(t,o,n,s);if((0,l.hasReadWriteCapability)(t)&&(0,l.hasOpenReadWriteCloseCapability)(n))return this.doPipeUnbufferedToBuffered(t,o,n,s);if((0,l.hasReadWriteCapability)(t)&&(0,l.hasReadWriteCapability)(n))return this.doPipeUnbuffered(t,o,n,s)}async doCopyFolder(t,o,n,s){await n.mkdir(s),Array.isArray(o.children)&&await O.Promises.settled(o.children.map(async i=>{const r=this.getExtUri(n).providerExtUri.joinPath(s,i.name);return i.isDirectory?this.doCopyFolder(t,await this.resolve(i.resource),n,r):this.doCopyFile(t,i.resource,n,r)}))}async doValidateMoveCopy(t,o,n,s,i,r){let a=!1;if(t===n){const{providerExtUri:v,isPathCaseSensitive:u}=this.getExtUri(t);if(u||(a=v.isEqual(o,s)),a&&i==="copy")throw new Error((0,w.localize)(14,null,this.resourceForError(o),this.resourceForError(s)));if(!a&&v.isEqualOrParent(s,o))throw new Error((0,w.localize)(15,null,this.resourceForError(o),this.resourceForError(s)))}const E=await this.exists(s);if(E&&!a){if(!r)throw new l.FileOperationError((0,w.localize)(16,null,this.resourceForError(o),this.resourceForError(s)),4);if(t===n){const{providerExtUri:v}=this.getExtUri(t);if(v.isEqualOrParent(o,s))throw new Error((0,w.localize)(17,null,this.resourceForError(o),this.resourceForError(s)))}}return{exists:E,isSameResourceWithDifferentPathCase:a}}getExtUri(t){const o=this.isPathCaseSensitive(t);return{providerExtUri:o?h.extUri:h.extUriIgnorePathCase,isPathCaseSensitive:o}}isPathCaseSensitive(t){return!!(t.capabilities&1024)}async createFolder(t){const o=this.throwIfFileSystemIsReadonly(await this.withProvider(t),t);await this.mkdirp(o,t);const n=await this.resolve(t,{resolveMetadata:!0});return this._onDidRunOperation.fire(new l.FileOperationEvent(t,0,n)),n}async mkdirp(t,o){const n=[],{providerExtUri:s}=this.getExtUri(t);for(;!s.isEqual(o,s.dirname(o));)try{if(!((await t.stat(o)).type&l.FileType.Directory))throw new Error((0,w.localize)(18,null,this.resourceForError(o)));break}catch(i){if((0,l.toFileSystemProviderErrorCode)(i)!==l.FileSystemProviderErrorCode.FileNotFound)throw i;n.push(s.basename(o)),o=s.dirname(o)}for(let i=n.length-1;i>=0;i--){o=s.joinPath(o,n[i]);try{await t.mkdir(o)}catch(r){if((0,l.toFileSystemProviderErrorCode)(r)!==l.FileSystemProviderErrorCode.FileExists)throw r}}}async canDelete(t,o){try{await this.doValidateDelete(t,o)}catch(n){return n}return!0}async doValidateDelete(t,o){const n=this.throwIfFileSystemIsReadonly(await this.withProvider(t),t),s=!!o?.useTrash;if(s&&!(n.capabilities&4096))throw new Error((0,w.localize)(19,null,this.resourceForError(t)));const i=o?.atomic;if(i&&!(n.capabilities&65536))throw new Error((0,w.localize)(20,null,this.resourceForError(t)));if(s&&i)throw new Error((0,w.localize)(21,null,this.resourceForError(t)));let r;try{r=await n.stat(t)}catch{}if(r)this.throwIfFileIsReadonly(t,r);else throw new l.FileOperationError((0,w.localize)(22,null,this.resourceForError(t)),1);if(!!!o?.recursive){const E=await this.resolve(t);if(E.isDirectory&&Array.isArray(E.children)&&E.children.length>0)throw new Error((0,w.localize)(23,null,this.resourceForError(t)))}return n}async del(t,o){const n=await this.doValidateDelete(t,o),s=!!o?.useTrash,i=!!o?.recursive,r=o?.atomic??!1;await n.delete(t,{recursive:i,useTrash:s,atomic:r}),this._onDidRunOperation.fire(new l.FileOperationEvent(t,1))}async cloneFile(t,o){const n=await this.withProvider(t),s=this.throwIfFileSystemIsReadonly(await this.withWriteProvider(o),o);if(n===s&&this.getExtUri(n).providerExtUri.isEqual(t,o))return;if(n===s&&(0,l.hasFileCloneCapability)(n))return n.cloneFile(t,o);await this.mkdirp(s,this.getExtUri(s).providerExtUri.dirname(o));const i=this.writeQueue.queueFor(t,this.getExtUri(n).providerExtUri);return n===s&&(0,l.hasFileFolderCopyCapability)(n)?i.queue(()=>n.copy(t,o,{overwrite:!0})):i.queue(()=>this.doCopyFile(n,t,s,o))}watch(t,o={recursive:!1,excludes:[]}){const n=new S.DisposableStore;let s=!1,i=()=>{s=!0};return n.add((0,S.toDisposable)(()=>i())),(async()=>{try{const r=await this.doWatch(t,o);s?(0,S.dispose)(r):i=()=>(0,S.dispose)(r)}catch(r){this.logService.error(r)}})(),n}async doWatch(t,o){const n=await this.withProvider(t),s=(0,D.hash)([this.getExtUri(n).providerExtUri.getComparisonKey(t),o]);let i=this.activeWatchers.get(s);return i||(i={count:0,disposable:n.watch(t,o)},this.activeWatchers.set(s,i)),i.count+=1,(0,S.toDisposable)(()=>{i&&(i.count--,i.count===0&&((0,S.dispose)(i.disposable),this.activeWatchers.delete(s)))})}dispose(){super.dispose();for(const[,t]of this.activeWatchers)(0,S.dispose)(t.disposable);this.activeWatchers.clear()}async doWriteBufferedAtomic(t,o,n,s,i){await this.doWriteBuffered(t,n,s,i);try{await t.rename(n,o,{overwrite:!0})}catch(r){try{await t.delete(n,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw r}}async doWriteBuffered(t,o,n,s){return this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(async()=>{const i=await t.open(o,{create:!0,unlock:n?.unlock??!1});try{(0,f.isReadableStream)(s)||(0,f.isReadableBufferedStream)(s)?await this.doWriteStreamBufferedQueued(t,i,s):await this.doWriteReadableBufferedQueued(t,i,s)}catch(r){throw(0,l.ensureFileSystemProviderError)(r)}finally{await t.close(i)}})}async doWriteStreamBufferedQueued(t,o,n){let s=0,i;if((0,f.isReadableBufferedStream)(n)){if(n.buffer.length>0){const r=A.VSBuffer.concat(n.buffer);await this.doWriteBuffer(t,o,r,r.byteLength,s,0),s+=r.byteLength}if(n.ended)return;i=n.stream}else i=n;return new Promise((r,a)=>{(0,f.listenStream)(i,{onData:async E=>{i.pause();try{await this.doWriteBuffer(t,o,E,E.byteLength,s,0)}catch(v){return a(v)}s+=E.byteLength,setTimeout(()=>i.resume())},onError:E=>a(E),onEnd:()=>r()})})}async doWriteReadableBufferedQueued(t,o,n){let s=0,i;for(;(i=n.read())!==null;)await this.doWriteBuffer(t,o,i,i.byteLength,s,0),s+=i.byteLength}async doWriteBuffer(t,o,n,s,i,r){let a=0;for(;a<s;){const E=await t.write(o,i+a,n.buffer,r+a,s-a);a+=E}}async doWriteUnbuffered(t,o,n,s){return this.writeQueue.queueFor(o,this.getExtUri(t).providerExtUri).queue(()=>this.doWriteUnbufferedQueued(t,o,n,s))}async doWriteUnbufferedQueued(t,o,n,s){let i;s instanceof A.VSBuffer?i=s:(0,f.isReadableStream)(s)?i=await(0,A.streamToBuffer)(s):(0,f.isReadableBufferedStream)(s)?i=await(0,A.bufferedStreamToBuffer)(s):i=(0,A.readableToBuffer)(s),await t.writeFile(o,i.buffer,{create:!0,overwrite:!0,unlock:n?.unlock??!1,atomic:n?.atomic??!1})}async doPipeBuffered(t,o,n,s){return this.writeQueue.queueFor(s,this.getExtUri(n).providerExtUri).queue(()=>this.doPipeBufferedQueued(t,o,n,s))}async doPipeBufferedQueued(t,o,n,s){let i,r;try{i=await t.open(o,{create:!1}),r=await n.open(s,{create:!0,unlock:!1});const a=A.VSBuffer.alloc(this.BUFFER_SIZE);let E=0,v=0,u=0;do u=await t.read(i,E,a.buffer,v,a.byteLength-v),await this.doWriteBuffer(n,r,a,u,E,v),E+=u,v+=u,v===a.byteLength&&(v=0);while(u>0)}catch(a){throw(0,l.ensureFileSystemProviderError)(a)}finally{await O.Promises.settled([typeof i=="number"?t.close(i):Promise.resolve(),typeof r=="number"?n.close(r):Promise.resolve()])}}async doPipeUnbuffered(t,o,n,s){return this.writeQueue.queueFor(s,this.getExtUri(n).providerExtUri).queue(()=>this.doPipeUnbufferedQueued(t,o,n,s))}async doPipeUnbufferedQueued(t,o,n,s){return n.writeFile(s,await t.readFile(o),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async doPipeUnbufferedToBuffered(t,o,n,s){return this.writeQueue.queueFor(s,this.getExtUri(n).providerExtUri).queue(()=>this.doPipeUnbufferedToBufferedQueued(t,o,n,s))}async doPipeUnbufferedToBufferedQueued(t,o,n,s){const i=await n.open(s,{create:!0,unlock:!1});try{const r=await t.readFile(o);await this.doWriteBuffer(n,i,A.VSBuffer.wrap(r),r.byteLength,0,0)}catch(r){throw(0,l.ensureFileSystemProviderError)(r)}finally{await n.close(i)}}async doPipeBufferedToUnbuffered(t,o,n,s){const i=await(0,A.streamToBuffer)(this.readFileBuffered(t,o,_.CancellationToken.None));await this.doWriteUnbuffered(n,s,void 0,i)}throwIfFileSystemIsReadonly(t,o){if(t.capabilities&2048)throw new l.FileOperationError((0,w.localize)(24,null,this.resourceForError(o)),6);return t}throwIfFileIsReadonly(t,o){if((o.permissions??0)&l.FilePermission.Readonly)throw new l.FileOperationError((0,w.localize)(25,null,this.resourceForError(t)),6)}resourceForError(t){return t.scheme===p.Schemas.file?t.fsPath:t.toString(!0)}};e.FileService=y,e.FileService=y=Ee([G(0,c.ILogService)],y)}),define(ce[200],le([0,1,52,271,5,35,14,3,48,2,16,6,22,43,31,162,13,101,198,38,194,193]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileSystemProvider=void 0,(()=>{try{(0,O.gracefulify)(I)}catch(o){console.error(`Error enabling graceful-fs: ${(0,m.toErrorMessage)(o)}`)}})();class t extends c.AbstractDiskFileSystemProvider{static{this.TRACE_LOG_RESOURCE_LOCKS=!1}constructor(n,s){super(n,s),this.onDidChangeCapabilities=D.Event.None,this.resourceLocks=new _.ResourceMap(i=>g.extUriBiasedIgnorePathCase.getComparisonKey(i)),this.mapHandleToPos=new Map,this.mapHandleToLock=new Map,this.writeHandles=new Map}get capabilities(){return this._capabilities||(this._capabilities=253982,p.isLinux&&(this._capabilities|=1024)),this._capabilities}async stat(n){try{const{stat:s,symbolicLink:i}=await f.SymlinkSupport.stat(this.toFilePath(n));return{type:this.toType(s,i),ctime:s.birthtime.getTime(),mtime:s.mtime.getTime(),size:s.size,permissions:s.mode&128?void 0:l.FilePermission.Locked}}catch(s){throw this.toFileSystemProviderError(s)}}async statIgnoreError(n){try{return await this.stat(n)}catch{return}}async readdir(n){try{const s=await f.Promises.readdir(this.toFilePath(n),{withFileTypes:!0}),i=[];return await Promise.all(s.map(async r=>{try{let a;r.isSymbolicLink()?a=(await this.stat((0,g.joinPath)(n,r.name))).type:a=this.toType(r),i.push([r.name,a])}catch(a){this.logService.trace(a)}})),i}catch(s){throw this.toFileSystemProviderError(s)}}toType(n,s){let i;return s?.dangling?i=l.FileType.Unknown:n.isFile()?i=l.FileType.File:n.isDirectory()?i=l.FileType.Directory:i=l.FileType.Unknown,s&&(i|=l.FileType.SymbolicLink),i}async createResourceLock(n){const s=this.toFilePath(n);this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${s})`);let i;for(;i=this.resourceLocks.get(n);)this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${s})`),await i.wait();const r=new A.Barrier;return this.resourceLocks.set(n,r),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${s})`),(0,S.toDisposable)(()=>{this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${s})`),this.resourceLocks.get(n)===r&&(this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${s})`),this.resourceLocks.delete(n)),this.traceLock(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${s})`),r.open()})}async readFile(n,s){let i;try{s?.atomic&&(this.traceLock(`[Disk FileSystemProvider]: atomic read operation started (${this.toFilePath(n)})`),i=await this.createResourceLock(n));const r=this.toFilePath(n);return await f.Promises.readFile(r)}catch(r){throw this.toFileSystemProviderError(r)}finally{i?.dispose()}}traceLock(n){t.TRACE_LOG_RESOURCE_LOCKS&&this.logService.trace(n)}readFileStream(n,s,i){const r=(0,h.newWriteableStream)(a=>k.VSBuffer.concat(a.map(E=>k.VSBuffer.wrap(E))).buffer);return(0,d.readFileIntoStream)(this,n,r,a=>a.buffer,{...s,bufferSize:256*1024},i),r}async writeFile(n,s,i){return i?.atomic!==!1&&i?.atomic?.postfix?this.doWriteFileAtomic(n,(0,g.joinPath)((0,g.dirname)(n),`${(0,g.basename)(n)}${i.atomic.postfix}`),s,i):this.doWriteFile(n,s,i)}async doWriteFileAtomic(n,s,i,r){await this.doWriteFile(s,i,r);try{await this.rename(s,n,{overwrite:!0})}catch(a){try{await this.delete(s,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw a}}async doWriteFile(n,s,i){let r;try{const a=this.toFilePath(n);if(!i.create||!i.overwrite){if(await f.Promises.exists(a)){if(!i.overwrite)throw(0,l.createFileSystemProviderError)((0,w.localize)(0,null),l.FileSystemProviderErrorCode.FileExists)}else if(!i.create)throw(0,l.createFileSystemProviderError)((0,w.localize)(1,null),l.FileSystemProviderErrorCode.FileNotFound)}r=await this.open(n,{create:!0,unlock:i.unlock}),await this.write(r,0,s,0,s.byteLength)}catch(a){throw await this.toFileSystemProviderWriteError(n,a)}finally{typeof r=="number"&&await this.close(r)}}static{this.canFlush=!0}static configureFlushOnWrite(n){t.canFlush=n}async open(n,s){const i=this.toFilePath(n);let r;(0,l.isFileOpenForWriteOptions)(s)&&(r=await this.createResourceLock(n));let a;try{if((0,l.isFileOpenForWriteOptions)(s)&&s.unlock)try{const{stat:v}=await f.SymlinkSupport.stat(i);v.mode&128||await f.Promises.chmod(i,v.mode|128)}catch(v){v.code!=="ENOENT"&&this.logService.trace(v)}let E;if((0,l.isFileOpenForWriteOptions)(s)){if(p.isWindows)try{await f.Promises.truncate(i,0),E="r+"}catch(v){v.code!=="ENOENT"&&this.logService.trace(v)}E||(E="w")}else E="r";a=await f.Promises.open(i,E)}catch(E){throw r?.dispose(),(0,l.isFileOpenForWriteOptions)(s)?await this.toFileSystemProviderWriteError(n,E):this.toFileSystemProviderError(E)}if(this.mapHandleToPos.set(a,0),(0,l.isFileOpenForWriteOptions)(s)&&this.writeHandles.set(a,n),r){const E=this.mapHandleToLock.get(a);this.traceLock(`[Disk FileSystemProvider]: open() - storing lock for handle ${a} (${i})`),this.mapHandleToLock.set(a,r),E&&(this.traceLock(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${a} (${i})`),E.dispose())}return a}async close(n){const s=this.mapHandleToLock.get(n);try{if(this.mapHandleToPos.delete(n),this.writeHandles.delete(n)&&t.canFlush)try{await f.Promises.fdatasync(n)}catch(i){t.configureFlushOnWrite(!1),this.logService.error(i)}return await f.Promises.close(n)}catch(i){throw this.toFileSystemProviderError(i)}finally{s&&(this.mapHandleToLock.get(n)===s&&(this.traceLock(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${n}`),this.mapHandleToLock.delete(n)),this.traceLock(`[Disk FileSystemProvider]: close() - disposing lock for handle ${n}`),s.dispose())}}async read(n,s,i,r,a){const E=this.normalizePos(n,s);let v=null;try{v=(await f.Promises.read(n,i,r,a,E)).bytesRead}catch(u){throw this.toFileSystemProviderError(u)}finally{this.updatePos(n,E,v)}return v}normalizePos(n,s){return s===this.mapHandleToPos.get(n)?null:s}updatePos(n,s,i){const r=this.mapHandleToPos.get(n);typeof r=="number"&&(typeof s=="number"||(typeof i=="number"?this.mapHandleToPos.set(n,r+i):this.mapHandleToPos.delete(n)))}async write(n,s,i,r,a){return(0,A.retry)(()=>this.doWrite(n,s,i,r,a),100,3)}async doWrite(n,s,i,r,a){const E=this.normalizePos(n,s);let v=null;try{v=(await f.Promises.write(n,i,r,a,E)).bytesWritten}catch(u){throw await this.toFileSystemProviderWriteError(this.writeHandles.get(n),u)}finally{this.updatePos(n,E,v)}return v}async mkdir(n){try{await f.Promises.mkdir(this.toFilePath(n))}catch(s){throw this.toFileSystemProviderError(s)}}async delete(n,s){try{const i=this.toFilePath(n);if(s.recursive){let r;s?.atomic!==!1&&s.atomic.postfix&&(r=(0,P.join)((0,P.dirname)(i),`${(0,P.basename)(i)}${s.atomic.postfix}`)),await f.Promises.rm(i,f.RimRafMode.MOVE,r)}else try{await f.Promises.unlink(i)}catch(r){if(r.code==="EPERM"||r.code==="EISDIR"){let a=!1;try{const{stat:E,symbolicLink:v}=await f.SymlinkSupport.stat(i);a=E.isDirectory()&&!v}catch{}if(a)await f.Promises.rmdir(i);else throw r}else throw r}}catch(i){throw this.toFileSystemProviderError(i)}}async rename(n,s,i){const r=this.toFilePath(n),a=this.toFilePath(s);if(r!==a)try{await this.validateMoveCopy(n,s,"move",i.overwrite),await f.Promises.rename(r,a)}catch(E){throw(E.code==="EINVAL"||E.code==="EBUSY"||E.code==="ENAMETOOLONG")&&(E=new Error((0,w.localize)(2,null,(0,P.basename)(r),(0,P.basename)((0,P.dirname)(a)),E.toString()))),this.toFileSystemProviderError(E)}}async copy(n,s,i){const r=this.toFilePath(n),a=this.toFilePath(s);if(r!==a)try{await this.validateMoveCopy(n,s,"copy",i.overwrite),await f.Promises.copy(r,a,{preserveSymlinks:!0})}catch(E){throw(E.code==="EINVAL"||E.code==="EBUSY"||E.code==="ENAMETOOLONG")&&(E=new Error((0,w.localize)(3,null,(0,P.basename)(r),(0,P.basename)((0,P.dirname)(a)),E.toString()))),this.toFileSystemProviderError(E)}}async validateMoveCopy(n,s,i,r){const a=this.toFilePath(n),E=this.toFilePath(s);let v=!1;if(!!(this.capabilities&1024)||(v=(0,b.isEqual)(a,E,!0)),v){if(i==="copy")throw(0,l.createFileSystemProviderError)((0,w.localize)(4,null),l.FileSystemProviderErrorCode.FileExists);if(i==="move")return}const C=await this.statIgnoreError(n);if(!C)throw(0,l.createFileSystemProviderError)((0,w.localize)(5,null),l.FileSystemProviderErrorCode.FileNotFound);const U=await this.statIgnoreError(s);if(U){if(!r)throw(0,l.createFileSystemProviderError)((0,w.localize)(6,null),l.FileSystemProviderErrorCode.FileExists);C.type&l.FileType.File&&U.type&l.FileType.File||await this.delete(s,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(n,s){return this.doCloneFile(n,s,!1)}async doCloneFile(n,s,i){const r=this.toFilePath(n),a=this.toFilePath(s),E=!!(this.capabilities&1024);if((0,b.isEqual)(r,a,!E))return;const v=new S.DisposableStore;try{const[u,C]=await Promise.all([this.createResourceLock(n),this.createResourceLock(s)]);v.add(u),v.add(C),i&&await f.Promises.mkdir((0,P.dirname)(a),{recursive:!0}),await f.Promises.copyFile(r,a)}catch(u){if(u.code==="ENOENT"&&!i)return this.doCloneFile(n,s,!0);throw this.toFileSystemProviderError(u)}finally{v.dispose()}}createUniversalWatcher(n,s,i){return new y.UniversalWatcherClient(r=>n(r),r=>s(r),i)}createNonRecursiveWatcher(n,s,i){return new T.NodeJSWatcherClient(r=>n(r),r=>s(r),i)}toFileSystemProviderError(n){if(n instanceof l.FileSystemProviderError)return n;let s=n,i;switch(n.code){case"ENOENT":i=l.FileSystemProviderErrorCode.FileNotFound;break;case"EISDIR":i=l.FileSystemProviderErrorCode.FileIsADirectory;break;case"ENOTDIR":i=l.FileSystemProviderErrorCode.FileNotADirectory;break;case"EEXIST":i=l.FileSystemProviderErrorCode.FileExists;break;case"EPERM":case"EACCES":i=l.FileSystemProviderErrorCode.NoPermissions;break;case"ERR_UNC_HOST_NOT_ALLOWED":s=`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,i=l.FileSystemProviderErrorCode.Unknown;break;default:i=l.FileSystemProviderErrorCode.Unknown}return(0,l.createFileSystemProviderError)(s,i)}async toFileSystemProviderWriteError(n,s){let i=this.toFileSystemProviderError(s);if(n&&i.code===l.FileSystemProviderErrorCode.NoPermissions)try{const{stat:r}=await f.SymlinkSupport.stat(this.toFilePath(n));r.mode&128||(i=(0,l.createFileSystemProviderError)(s,l.FileSystemProviderErrorCode.FileWriteLocked))}catch(r){this.logService.trace(r)}return i}}e.DiskFileSystemProvider=t}),define(ce[103],le([0,1,3,2,4,7]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedProcessLifecycleService=e.ISharedProcessLifecycleService=void 0,e.ISharedProcessLifecycleService=(0,A.createDecorator)("sharedProcessLifecycleService");let k=class extends O.Disposable{constructor(b){super(),this.logService=b,this._onWillShutdown=this._register(new I.Emitter),this.onWillShutdown=this._onWillShutdown.event}fireOnWillShutdown(){this.logService.trace("Lifecycle#onWillShutdown.fire()"),this._onWillShutdown.fire()}};e.SharedProcessLifecycleService=k,e.SharedProcessLifecycleService=k=Ee([G(0,_.ILogService)],k)}),define(ce[201],le([0,1,11,3,7,2]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteLoggerChannelClient=e.LoggerChannel=e.LoggerChannelClient=void 0;class k extends A.AbstractLoggerService{constructor(p,g,h,f,w){super(g,h,f),this.windowId=p,this.channel=w,this._register(w.listen("onDidChangeLogLevel",p)(l=>{(0,A.isLogLevel)(l)?super.setLogLevel(l):super.setLogLevel(I.URI.revive(l[0]),l[1])})),this._register(w.listen("onDidChangeVisibility",p)(([l,d])=>super.setVisibility(I.URI.revive(l),d))),this._register(w.listen("onDidChangeLoggers",p)(({added:l,removed:d})=>{for(const c of l)super.registerLogger({...c,resource:I.URI.revive(c.resource)});for(const c of d)super.deregisterLogger(c.resource)}))}createConsoleMainLogger(){return new A.AdapterLogger({log:(p,g)=>{this.channel.call("consoleLog",[p,g])}})}registerLogger(p){super.registerLogger(p),this.channel.call("registerLogger",[p,this.windowId])}deregisterLogger(p){super.deregisterLogger(p),this.channel.call("deregisterLogger",[p,this.windowId])}setLogLevel(p,g){super.setLogLevel(p,g),this.channel.call("setLogLevel",[p,g])}setVisibility(p,g){super.setVisibility(p,g),this.channel.call("setVisibility",[this.toResource(p),g])}doCreateLogger(p,g,h){return new D(this.channel,p,g,h,this.windowId)}static setLogLevel(p,g,h){return p.call("setLogLevel",[g,h])}}e.LoggerChannelClient=k;class D extends A.AbstractMessageLogger{constructor(p,g,h,f,w){super(f?.logLevel==="always"),this.channel=p,this.file=g,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(h),this.channel.call("createLogger",[g,f,w]).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(p,g){const h=[[p,g]];this.isLoggerCreated?this.doLog(h):this.buffer.push(...h)}doLog(p){this.channel.call("log",[this.file,p])}}class b{constructor(p,g){this.loggerService=p,this.getUriTransformer=g}listen(p,g){const h=this.getUriTransformer(p);switch(g){case"onDidChangeLoggers":return O.Event.map(this.loggerService.onDidChangeLoggers,f=>({added:[...f.added].map(w=>this.transformLogger(w,h)),removed:[...f.removed].map(w=>this.transformLogger(w,h))}));case"onDidChangeVisibility":return O.Event.map(this.loggerService.onDidChangeVisibility,f=>[h.transformOutgoingURI(f[0]),f[1]]);case"onDidChangeLogLevel":return O.Event.map(this.loggerService.onDidChangeLogLevel,f=>(0,A.isLogLevel)(f)?f:[h.transformOutgoingURI(f[0]),f[1]])}throw new Error(`Event not found: ${g}`)}async call(p,g,h){const f=this.getUriTransformer(p);switch(g){case"setLogLevel":return(0,A.isLogLevel)(h[0])?this.loggerService.setLogLevel(h[0]):this.loggerService.setLogLevel(I.URI.revive(f.transformIncoming(h[0][0])),h[0][1]);case"getRegisteredLoggers":return Promise.resolve([...this.loggerService.getRegisteredLoggers()].map(w=>this.transformLogger(w,f)))}throw new Error(`Call not found: ${g}`)}transformLogger(p,g){return{...p,resource:g.transformOutgoingURI(p.resource)}}}e.LoggerChannel=b;class S extends _.Disposable{constructor(p,g){super(),g.call("setLogLevel",[p.getLogLevel()]),this._register(p.onDidChangeLogLevel(h=>g.call("setLogLevel",[h]))),g.call("getRegisteredLoggers").then(h=>{for(const f of h)p.registerLogger({...f,resource:I.URI.revive(f.resource)})}),this._register(g.listen("onDidChangeVisibility")(([h,f])=>p.setVisibility(I.URI.revive(h),f))),this._register(g.listen("onDidChangeLoggers")(({added:h,removed:f})=>{for(const w of h)p.registerLogger({...w,resource:I.URI.revive(w.resource)});for(const w of f)p.deregisterLogger(w.resource)}))}}e.RemoteLoggerChannelClient=S}),define(ce[202],le([0,1,2,7]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogService=void 0;class A extends I.Disposable{constructor(k,D=[]){super(),this.logger=new O.MultiplexLogger([k,...D]),this._register(k.onDidChangeLogLevel(b=>this.setLevel(b)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(k){this.logger.setLevel(k)}getLevel(){return this.logger.getLevel()}trace(k,...D){this.logger.trace(k,...D)}debug(k,...D){this.logger.debug(k,...D)}info(k,...D){this.logger.info(k,...D)}warn(k,...D){this.logger.warn(k,...D)}error(k,...D){this.logger.error(k,...D)}flush(){this.logger.flush()}}e.LogService=A}),define(ce[55],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.INativeHostService=void 0,e.INativeHostService=(0,I.createDecorator)("nativeHostService")}),define(ce[56],le([0,1,3,59,2,4]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NullPolicyService=e.AbstractPolicyService=e.IPolicyService=void 0,e.IPolicyService=(0,_.createDecorator)("policy");class k extends A.Disposable{constructor(){super(...arguments),this.policyDefinitions={},this.policies=new Map,this._onDidChange=this._register(new I.Emitter),this.onDidChange=this._onDidChange.event}async updatePolicyDefinitions(S){const P=Object.keys(this.policyDefinitions).length;return this.policyDefinitions={...S,...this.policyDefinitions},P!==Object.keys(this.policyDefinitions).length&&await this._updatePolicyDefinitions(S),O.Iterable.reduce(this.policies.entries(),(p,[g,h])=>({...p,[g]:h}),{})}getPolicyValue(S){return this.policies.get(S)}serialize(){return O.Iterable.reduce(Object.entries(this.policyDefinitions),(S,[P,p])=>({...S,[P]:{definition:p,value:this.policies.get(P)}}),{})}}e.AbstractPolicyService=k;class D{constructor(){this.onDidChange=I.Event.None}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}}e.NullPolicyService=D}),define(ce[203],le([0,1,3,2,56]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolicyChannelClient=e.PolicyChannel=void 0;class _{constructor(b){this.service=b,this.disposables=new O.DisposableStore}listen(b,S){switch(S){case"onDidChange":return I.Event.map(this.service.onDidChange,P=>P.reduce((p,g)=>({...p,[g]:this.service.getPolicyValue(g)??null}),{}),this.disposables)}throw new Error(`Event not found: ${S}`)}call(b,S,P){switch(S){case"updatePolicyDefinitions":return this.service.updatePolicyDefinitions(P)}throw new Error(`Call not found: ${S}`)}dispose(){this.disposables.dispose()}}e.PolicyChannel=_;class k extends A.AbstractPolicyService{constructor(b,S){super(),this.channel=S;for(const P in b){const{definition:p,value:g}=b[P];this.policyDefinitions[P]=p,g!==void 0&&this.policies.set(P,g)}this.channel.listen("onDidChange")(P=>{for(const p in P){const g=P[p];g===null?this.policies.delete(p):this.policies.set(p,g)}this._onDidChange.fire(Object.keys(P))})}async _updatePolicyDefinitions(b){const S=await this.channel.call("updatePolicyDefinitions",b);for(const P in S)this.policies.set(P,S[P])}}e.PolicyChannelClient=k}),define(ce[72],le([0,1,6,37]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let A;if(typeof I.globals.vscode<"u"&&typeof I.globals.vscode.context<"u"){const _=I.globals.vscode.context.configuration();if(_)A=_.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(A=globalThis._VSCODE_PRODUCT_JSON,O.env.VSCODE_DEV&&Object.assign(A,{nameShort:`${A.nameShort} Dev`,nameLong:`${A.nameLong} Dev`,dataFolderName:`${A.dataFolderName}-dev`,serverDataFolderName:A.serverDataFolderName?`${A.serverDataFolderName}-dev`:void 0}),!A.version){const _=globalThis._VSCODE_PACKAGE_JSON;Object.assign(A,{version:_.version})}}else A={},Object.keys(A).length===0&&Object.assign(A,{version:"1.78.0-dev",nameShort:"Azure Data Studio Dev",nameLong:"Azure Data Studio Dev",applicationName:"azuredatastudio-oss",dataFolderName:"azuredatastudio-oss",urlProtocol:"azuredatastudio-oss",reportIssueUrl:"https://github.com/microsoft/azuredatastudio/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});e.default=A}),define(ce[23],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.productSchemaId=e.IProductService=void 0,e.IProductService=(0,I.createDecorator)("productService"),e.productSchemaId="vscode://schemas/vscode-product"}),define(ce[204],le([0,1,5,8,2,16,31,7,23]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CodeCacheCleaner=void 0;let S=class extends A.Disposable{constructor(p,g,h){super(),this.productService=g,this.logService=h,this._DataMaxAge=this.productService.quality!=="stable"?1e3*60*60*24*7:1e3*60*60*24*30*3,p&&this._register(new I.RunOnceScheduler(()=>{this.cleanUpCodeCaches(p)},3e4)).schedule()}async cleanUpCodeCaches(p){this.logService.trace("[code cache cleanup]: Starting to clean up old code cache folders.");try{const g=Date.now(),h=(0,_.dirname)(p),f=(0,_.basename)(p),w=await k.Promises.readdir(h);await Promise.all(w.map(async l=>{if(l===f)return;const d=(0,_.join)(h,l),c=await k.Promises.stat(d);if(c.isDirectory()&&g-c.mtime.getTime()>this._DataMaxAge)return this.logService.trace(`[code cache cleanup]: Removing code cache folder ${l}.`),k.Promises.rm(d)}))}catch(g){(0,O.onUnexpectedError)(g)}}};e.CodeCacheCleaner=S,e.CodeCacheCleaner=S=Ee([G(1,b.IProductService),G(2,D.ILogService)],S)}),define(ce[205],le([0,1,5,8,2,16,31,15,7,23]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LanguagePackCachedDataCleaner=void 0;let P=class extends A.Disposable{constructor(g,h,f){super(),this.environmentService=g,this.logService=h,this.productService=f,this._DataMaxAge=this.productService.quality!=="stable"?1e3*60*60*24*7:1e3*60*60*24*30*3,this.environmentService.isBuilt&&this._register(new I.RunOnceScheduler(()=>{this.cleanUpLanguagePackCache()},4e4)).schedule()}async cleanUpLanguagePackCache(){this.logService.trace("[language pack cache cleanup]: Starting to clean up unused language packs.");try{const g=Object.create(null),h=JSON.parse(await k.Promises.readFile((0,_.join)(this.environmentService.userDataPath,"languagepacks.json"),"utf8"));for(const c of Object.keys(h)){const m=h[c];g[`${m.hash}.${c}`]=!0}const f=(0,_.join)(this.environmentService.userDataPath,"clp");if(!await k.Promises.exists(f))return;const l=await k.Promises.readdir(f);for(const c of l){if(g[c]){this.logService.trace(`[language pack cache cleanup]: Skipping folder ${c}. Language pack still in use.`);continue}this.logService.trace(`[language pack cache cleanup]: Removing unused language pack: ${c}`),await k.Promises.rm((0,_.join)(f,c))}const d=Date.now();for(const c of Object.keys(g)){const m=(0,_.join)(f,c),y=await k.Promises.readdir(m);for(const T of y){if(T==="tcf.json")continue;const t=(0,_.join)(m,T),o=await k.Promises.stat(t);o.isDirectory()&&d-o.mtime.getTime()>this._DataMaxAge&&(this.logService.trace(`[language pack cache cleanup]: Removing language pack cache folder: ${(0,_.join)(c,T)}`),await k.Promises.rm(t))}}}catch(g){(0,O.onUnexpectedError)(g)}}};e.LanguagePackCachedDataCleaner=P,e.LanguagePackCachedDataCleaner=P=Ee([G(0,D.INativeEnvironmentService),G(1,b.ILogService),G(2,S.IProductService)],P)}),define(ce[206],le([0,1,16,4]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Utils=e.IV8InspectProfilingService=void 0,e.IV8InspectProfilingService=(0,O.createDecorator)("IV8InspectProfilingService");var A;(function(_){function k(b){return!!(b.samples&&b.timeDeltas)}_.isValidProfile=k;function D(b,S="noAbsolutePaths"){for(const P of b.nodes)P.callFrame&&P.callFrame.url&&((0,I.isAbsolute)(P.callFrame.url)||/^\w[\w\d+.-]*:\/\/\/?/.test(P.callFrame.url))&&(P.callFrame.url=(0,I.join)(S,(0,I.basename)(P.callFrame.url)));return b}_.rewriteAbsolutePaths=D})(A||(e.Utils=A={}))}),define(ce[207],le([0,1,32]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InspectProfilingService=void 0;class O{constructor(){this._sessions=new Map}async startProfiling(_){const D=await(await new Promise((S,P)=>{te(["v8-inspect-profiler"],S,P)})).startProfiling({port:_.port,checkForPaused:!0}),b=(0,I.generateUuid)();return this._sessions.set(b,D),b}async stopProfiling(_){const k=this._sessions.get(_);if(!k)throw new Error(`UNKNOWN session '${_}'`);const D=await k.stop();return this._sessions.delete(_),D.profile}}e.InspectProfilingService=O}),define(ce[40],le([0,1,126,12]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;class A{constructor(){this.data=new Map}add(k,D){I.ok(O.isString(k)),I.ok(O.isObject(D)),I.ok(!this.data.has(k),"There is already an extension with this id"),this.data.set(k,D)}knows(k){return this.data.has(k)}as(k){return this.data.get(k)||null}}e.Registry=new A}),define(ce[104],le([0,1,3,40]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Extensions=void 0,e.Extensions={JSONContribution:"base.contributions.json"};function A(D){return D.length>0&&D.charAt(D.length-1)==="#"?D.substring(0,D.length-1):D}class _{constructor(){this._onDidChangeSchema=new I.Emitter,this.onDidChangeSchema=this._onDidChangeSchema.event,this.schemasById={}}registerSchema(b,S){this.schemasById[A(b)]=S,this._onDidChangeSchema.fire(b)}notifySchemaChanged(b){this._onDidChangeSchema.fire(b)}getSchemaContributions(){return{schemas:this.schemasById}}}const k=new _;O.Registry.add(e.Extensions.JSONContribution,k)}),define(ce[49],le([0,1,20,3,12,149,18,104,40]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getScopes=e.validateProperty=e.getDefaultValue=e.keyFromOverrideIdentifiers=e.overrideIdentifiersFromKey=e.OVERRIDE_PROPERTY_REGEX=e.OVERRIDE_PROPERTY_PATTERN=e.configurationDefaultsSchemaId=e.resourceLanguageSettingsSchemaId=e.resourceSettings=e.windowSettings=e.machineOverridableSettings=e.machineSettings=e.applicationSettings=e.allSettings=e.ConfigurationScope=e.Extensions=e.EditPresentationTypes=void 0;var S;(function(T){T.Multiline="multilineText",T.Singleline="singlelineText"})(S||(e.EditPresentationTypes=S={})),e.Extensions={Configuration:"base.contributions.configuration"};var P;(function(T){T[T.APPLICATION=1]="APPLICATION",T[T.MACHINE=2]="MACHINE",T[T.WINDOW=3]="WINDOW",T[T.RESOURCE=4]="RESOURCE",T[T.LANGUAGE_OVERRIDABLE=5]="LANGUAGE_OVERRIDABLE",T[T.MACHINE_OVERRIDABLE=6]="MACHINE_OVERRIDABLE"})(P||(e.ConfigurationScope=P={})),e.allSettings={properties:{},patternProperties:{}},e.applicationSettings={properties:{},patternProperties:{}},e.machineSettings={properties:{},patternProperties:{}},e.machineOverridableSettings={properties:{},patternProperties:{}},e.windowSettings={properties:{},patternProperties:{}},e.resourceSettings={properties:{},patternProperties:{}},e.resourceLanguageSettingsSchemaId="vscode://schemas/settings/resourceLanguage",e.configurationDefaultsSchemaId="vscode://schemas/settings/configurationDefaults";const p=b.Registry.as(D.Extensions.JSONContribution);class g{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new O.Emitter,this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=new O.Emitter,this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:_.localize(0,null),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},p.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(t,o=!0){this.registerConfigurations([t],o)}registerConfigurations(t,o=!0){const n=new Set;this.doRegisterConfigurations(t,o,n),p.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}deregisterConfigurations(t){const o=new Set;this.doDeregisterConfigurations(t,o),p.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o})}updateConfigurations({add:t,remove:o}){const n=new Set;this.doDeregisterConfigurations(o,n),this.doRegisterConfigurations(t,!1,n),p.registerSchema(e.resourceLanguageSettingsSchemaId,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(t){const o=new Set;this.doRegisterDefaultConfigurations(t,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:!0})}doRegisterDefaultConfigurations(t,o){const n=[];for(const{overrides:s,source:i}of t)for(const r in s)if(o.add(r),e.OVERRIDE_PROPERTY_REGEX.test(r)){const a=this.configurationDefaultsOverrides.get(r),E=a?.valuesSources??new Map;if(i)for(const U of Object.keys(s[r]))E.set(U,i);const v={...a?.value||{},...s[r]};this.configurationDefaultsOverrides.set(r,{source:i,value:v,valuesSources:E});const u=(0,k.getLanguageTagSettingPlainKey)(r),C={type:"object",default:v,description:_.localize(1,null,u),$ref:e.resourceLanguageSettingsSchemaId,defaultDefaultValue:v,source:A.isString(i)?void 0:i,defaultValueSource:i};n.push(...w(r)),this.configurationProperties[r]=C,this.defaultLanguageConfigurationOverridesNode.properties[r]=C}else{this.configurationDefaultsOverrides.set(r,{value:s[r],source:i});const a=this.configurationProperties[r];a&&(this.updatePropertyDefaultValue(r,a),this.updateSchema(r,a))}this.doRegisterOverrideIdentifiers(n)}deregisterDefaultConfigurations(t){const o=new Set;this.doDeregisterDefaultConfigurations(t,o),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:o,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(t,o){for(const{overrides:n,source:s}of t)for(const i in n){const r=this.configurationDefaultsOverrides.get(i),a=A.isString(s)?s:s?.id,E=A.isString(r?.source)?r?.source:r?.source?.id;if(a===E)if(o.add(i),this.configurationDefaultsOverrides.delete(i),e.OVERRIDE_PROPERTY_REGEX.test(i))delete this.configurationProperties[i],delete this.defaultLanguageConfigurationOverridesNode.properties[i];else{const v=this.configurationProperties[i];v&&(this.updatePropertyDefaultValue(i,v),this.updateSchema(i,v))}}this.updateOverridePropertyPatternKey()}deltaConfiguration(t){let o=!1;const n=new Set;t.removedDefaults&&(this.doDeregisterDefaultConfigurations(t.removedDefaults,n),o=!0),t.addedDefaults&&(this.doRegisterDefaultConfigurations(t.addedDefaults,n),o=!0),t.removedConfigurations&&this.doDeregisterConfigurations(t.removedConfigurations,n),t.addedConfigurations&&this.doRegisterConfigurations(t.addedConfigurations,!1,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:o})}notifyConfigurationSchemaUpdated(...t){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(t){this.doRegisterOverrideIdentifiers(t),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(t){for(const o of t)this.overrideIdentifiers.add(o);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(t,o,n){t.forEach(s=>{this.validateAndRegisterProperties(s,o,s.extensionInfo,s.restrictedProperties,void 0,n),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}doDeregisterConfigurations(t,o){const n=s=>{if(s.properties)for(const i in s.properties){o.add(i);const r=this.configurationProperties[i];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[i],this.removeFromSchema(i,s.properties[i])}s.allOf?.forEach(i=>n(i))};for(const s of t){n(s);const i=this.configurationContributors.indexOf(s);i!==-1&&this.configurationContributors.splice(i,1)}}validateAndRegisterProperties(t,o=!0,n,s,i=3,r){i=A.isUndefinedOrNull(t.scope)?i:t.scope;const a=t.properties;if(a)for(const v in a){const u=a[v];if(o&&m(v,u)){delete a[v];continue}if(u.source=n,u.defaultDefaultValue=a[v].default,this.updatePropertyDefaultValue(v,u),e.OVERRIDE_PROPERTY_REGEX.test(v)?u.scope=void 0:(u.scope=A.isUndefinedOrNull(u.scope)?i:u.scope,u.restricted=A.isUndefinedOrNull(u.restricted)?!!s?.includes(v):u.restricted),a[v].hasOwnProperty("included")&&!a[v].included){this.excludedConfigurationProperties[v]=a[v],delete a[v];continue}else this.configurationProperties[v]=a[v],a[v].policy?.name&&this.policyConfigurations.set(a[v].policy.name,v);!a[v].deprecationMessage&&a[v].markdownDeprecationMessage&&(a[v].deprecationMessage=a[v].markdownDeprecationMessage),r.add(v)}const E=t.allOf;if(E)for(const v of E)this.validateAndRegisterProperties(v,o,n,s,i,r)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getConfigurationDefaultsOverrides(){return this.configurationDefaultsOverrides}registerJSONConfiguration(t){const o=n=>{const s=n.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);n.allOf?.forEach(o)};o(t)}updateSchema(t,o){switch(e.allSettings.properties[t]=o,o.scope){case 1:e.applicationSettings.properties[t]=o;break;case 2:e.machineSettings.properties[t]=o;break;case 6:e.machineOverridableSettings.properties[t]=o;break;case 3:e.windowSettings.properties[t]=o;break;case 4:e.resourceSettings.properties[t]=o;break;case 5:e.resourceSettings.properties[t]=o,this.resourceLanguageSettingsSchema.properties[t]=o;break}}removeFromSchema(t,o){switch(delete e.allSettings.properties[t],o.scope){case 1:delete e.applicationSettings.properties[t];break;case 2:delete e.machineSettings.properties[t];break;case 6:delete e.machineOverridableSettings.properties[t];break;case 3:delete e.windowSettings.properties[t];break;case 4:case 5:delete e.resourceSettings.properties[t],delete this.resourceLanguageSettingsSchema.properties[t];break}}updateOverridePropertyPatternKey(){for(const t of this.overrideIdentifiers.values()){const o=`[${t}]`,n={type:"object",description:_.localize(2,null),errorMessage:_.localize(3,null),$ref:e.resourceLanguageSettingsSchemaId};this.updatePropertyDefaultValue(o,n),e.allSettings.properties[o]=n,e.applicationSettings.properties[o]=n,e.machineSettings.properties[o]=n,e.machineOverridableSettings.properties[o]=n,e.windowSettings.properties[o]=n,e.resourceSettings.properties[o]=n}}registerOverridePropertyPatternKey(){const t={type:"object",description:_.localize(4,null),errorMessage:_.localize(5,null),$ref:e.resourceLanguageSettingsSchemaId};e.allSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.applicationSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.machineSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.machineOverridableSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.windowSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,e.resourceSettings.patternProperties[e.OVERRIDE_PROPERTY_PATTERN]=t,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(t,o){const n=this.configurationDefaultsOverrides.get(t);let s=n?.value,i=n?.source;A.isUndefined(s)&&(s=o.defaultDefaultValue,i=void 0),A.isUndefined(s)&&(s=d(o.type)),o.default=s,o.defaultValueSource=i}}const h="\\[([^\\]]+)\\]",f=new RegExp(h,"g");e.OVERRIDE_PROPERTY_PATTERN=`^(${h})+$`,e.OVERRIDE_PROPERTY_REGEX=new RegExp(e.OVERRIDE_PROPERTY_PATTERN);function w(T){const t=[];if(e.OVERRIDE_PROPERTY_REGEX.test(T)){let o=f.exec(T);for(;o?.length;){const n=o[1].trim();n&&t.push(n),o=f.exec(T)}}return(0,I.distinct)(t)}e.overrideIdentifiersFromKey=w;function l(T){return T.reduce((t,o)=>`${t}[${o}]`,"")}e.keyFromOverrideIdentifiers=l;function d(T){switch(Array.isArray(T)?T[0]:T){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}e.getDefaultValue=d;const c=new g;b.Registry.add(e.Extensions.Configuration,c);function m(T,t){return T.trim()?e.OVERRIDE_PROPERTY_REGEX.test(T)?_.localize(7,null,T):c.getConfigurationProperties()[T]!==void 0?_.localize(8,null,T):t.policy?.name&&c.getPolicyConfigurations().get(t.policy?.name)!==void 0?_.localize(9,null,T,t.policy?.name,c.getPolicyConfigurations().get(t.policy?.name)):null:_.localize(6,null)}e.validateProperty=m;function y(){const T=[],t=c.getConfigurationProperties();for(const o of Object.keys(t))T.push([o,t[o].scope]);return T.push(["launch",4]),T.push(["task",4]),T}e.getScopes=y}),define(ce[73],le([0,1,20,3,34,2,35,30,12,11,18,49,40]),function(te,e,I,O,A,_,k,D,b,S,P,p,g){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationChangeEvent=e.mergeChanges=e.Configuration=e.UserSettings=e.ConfigurationModelParser=e.ConfigurationModel=void 0;function h(o){return Object.isFrozen(o)?o:D.deepFreeze(o)}class f{constructor(n={},s=[],i=[],r){this._contents=n,this._keys=s,this._overrides=i,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw?.length){const n=this.raw.map(s=>{if(s instanceof f)return s;const i=new w("");return i.parseRaw(s),i.configurationModel});this._rawConfiguration=n.reduce((s,i)=>i===s?i:s.merge(i),n[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(n){return n?(0,P.getConfigurationValue)(this.contents,n):this.contents}inspect(n,s){const i=this.rawConfiguration.getValue(n),r=s?this.rawConfiguration.getOverrideValue(n,s):void 0,a=s?this.rawConfiguration.override(s).getValue(n):i;return{value:i,override:r,merged:a}}getOverrideValue(n,s){const i=this.getContentsForOverrideIdentifer(s);return i?n?(0,P.getConfigurationValue)(i,n):i:void 0}getKeysForOverrideIdentifier(n){const s=[];for(const i of this.overrides)i.identifiers.includes(n)&&s.push(...i.keys);return I.distinct(s)}getAllOverrideIdentifiers(){const n=[];for(const s of this.overrides)n.push(...s.identifiers);return I.distinct(n)}override(n){let s=this.overrideConfigurations.get(n);return s||(s=this.createOverrideConfigurationModel(n),this.overrideConfigurations.set(n,s)),s}merge(...n){const s=D.deepClone(this.contents),i=D.deepClone(this.overrides),r=[...this.keys],a=this.raw?.length?[...this.raw]:[this];for(const E of n)if(a.push(...E.raw?.length?E.raw:[E]),!E.isEmpty()){this.mergeContents(s,E.contents);for(const v of E.overrides){const[u]=i.filter(C=>I.equals(C.identifiers,v.identifiers));u?(this.mergeContents(u.contents,v.contents),u.keys.push(...v.keys),u.keys=I.distinct(u.keys)):i.push(D.deepClone(v))}for(const v of E.keys)r.indexOf(v)===-1&&r.push(v)}return new f(s,r,i,a.every(E=>E instanceof f)?void 0:a)}createOverrideConfigurationModel(n){const s=this.getContentsForOverrideIdentifer(n);if(!s||typeof s!="object"||!Object.keys(s).length)return this;const i={};for(const r of I.distinct([...Object.keys(this.contents),...Object.keys(s)])){let a=this.contents[r];const E=s[r];E&&(typeof a=="object"&&typeof E=="object"?(a=D.deepClone(a),this.mergeContents(a,E)):a=E),i[r]=a}return new f(i,this.keys,this.overrides)}mergeContents(n,s){for(const i of Object.keys(s)){if(i in n&&b.isObject(n[i])&&b.isObject(s[i])){this.mergeContents(n[i],s[i]);continue}n[i]=D.deepClone(s[i])}}getContentsForOverrideIdentifer(n){let s=null,i=null;const r=a=>{a&&(i?this.mergeContents(i,a):i=D.deepClone(a))};for(const a of this.overrides)a.identifiers.length===1&&a.identifiers[0]===n?s=a.contents:a.identifiers.includes(n)&&r(a.contents);return r(s),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(n,s){this.updateValue(n,s,!0)}setValue(n,s){this.updateValue(n,s,!1)}removeValue(n){const s=this.keys.indexOf(n);s!==-1&&(this.keys.splice(s,1),(0,P.removeFromValueTree)(this.contents,n),p.OVERRIDE_PROPERTY_REGEX.test(n)&&this.overrides.splice(this.overrides.findIndex(i=>I.equals(i.identifiers,(0,p.overrideIdentifiersFromKey)(n))),1))}updateValue(n,s,i){(0,P.addToValueTree)(this.contents,n,s,r=>console.error(r)),i=i||this.keys.indexOf(n)===-1,i&&this.keys.push(n),p.OVERRIDE_PROPERTY_REGEX.test(n)&&this.overrides.push({identifiers:(0,p.overrideIdentifiersFromKey)(n),keys:Object.keys(this.contents[n]),contents:(0,P.toValuesTree)(this.contents[n],r=>console.error(r))})}}e.ConfigurationModel=f;class w{constructor(n){this._name=n,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||new f}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(n,s){if(!b.isUndefinedOrNull(n)){const i=this.doParseContent(n);this.parseRaw(i,s)}}reparse(n){this._raw&&this.parseRaw(this._raw,n)}parseRaw(n,s){this._raw=n;const{contents:i,keys:r,overrides:a,restricted:E,hasExcludedProperties:v}=this.doParseRaw(n,s);this._configurationModel=new f(i,r,a,v?[n]:void 0),this._restrictedConfigurations=E||[]}doParseContent(n){let s={},i=null,r=[];const a=[],E=[];function v(C){Array.isArray(r)?r.push(C):i!==null&&(r[i]=C)}const u={onObjectBegin:()=>{const C={};v(C),a.push(r),r=C,i=null},onObjectProperty:C=>{i=C},onObjectEnd:()=>{r=a.pop()},onArrayBegin:()=>{const C=[];v(C),a.push(r),r=C,i=null},onArrayEnd:()=>{r=a.pop()},onLiteralValue:v,onError:(C,U,F)=>{E.push({error:C,offset:U,length:F})}};if(n)try{A.visit(n,u),s=r[0]||{}}catch(C){console.error(`Error while parsing settings file ${this._name}: ${C}`),this._parseErrors=[C]}return s}doParseRaw(n,s){const i=g.Registry.as(p.Extensions.Configuration).getConfigurationProperties(),r=this.filter(n,i,!0,s);n=r.raw;const a=(0,P.toValuesTree)(n,u=>console.error(`Conflict in settings file ${this._name}: ${u}`)),E=Object.keys(n),v=this.toOverrides(n,u=>console.error(`Conflict in settings file ${this._name}: ${u}`));return{contents:a,keys:E,overrides:v,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(n,s,i,r){let a=!1;if(!r?.scopes&&!r?.skipRestricted&&!r?.exclude?.length)return{raw:n,restricted:[],hasExcludedProperties:a};const E={},v=[];for(const u in n)if(p.OVERRIDE_PROPERTY_REGEX.test(u)&&i){const C=this.filter(n[u],s,!1,r);E[u]=C.raw,a=a||C.hasExcludedProperties,v.push(...C.restricted)}else{const C=s[u],U=C?typeof C.scope<"u"?C.scope:3:void 0;C?.restricted&&v.push(u),!r.exclude?.includes(u)&&(r.include?.includes(u)||(U===void 0||r.scopes===void 0||r.scopes.includes(U))&&!(r.skipRestricted&&C?.restricted))?E[u]=n[u]:a=!0}return{raw:E,restricted:v,hasExcludedProperties:a}}toOverrides(n,s){const i=[];for(const r of Object.keys(n))if(p.OVERRIDE_PROPERTY_REGEX.test(r)){const a={};for(const E in n[r])a[E]=n[r][E];i.push({identifiers:(0,p.overrideIdentifiersFromKey)(r),keys:Object.keys(a),contents:(0,P.toValuesTree)(a,s)})}return i}}e.ConfigurationModelParser=w;class l extends _.Disposable{constructor(n,s,i,r){super(),this.userSettingsResource=n,this.parseOptions=s,this.fileService=r,this._onDidChange=this._register(new O.Emitter),this.onDidChange=this._onDidChange.event,this.parser=new w(this.userSettingsResource.toString()),this._register(this.fileService.watch(i.dirname(this.userSettingsResource))),this._register(this.fileService.watch(this.userSettingsResource)),this._register(O.Event.any(O.Event.filter(this.fileService.onDidFilesChange,a=>a.contains(this.userSettingsResource)),O.Event.filter(this.fileService.onDidRunOperation,a=>(a.isOperation(0)||a.isOperation(3)||a.isOperation(1)||a.isOperation(4))&&i.isEqual(a.resource,n)))(()=>this._onDidChange.fire()))}async loadConfiguration(){try{const n=await this.fileService.readFile(this.userSettingsResource);return this.parser.parse(n.value.toString()||"{}",this.parseOptions),this.parser.configurationModel}catch{return new f}}reparse(n){return n&&(this.parseOptions=n),this.parser.reparse(this.parseOptions),this.parser.configurationModel}getRestrictedSettings(){return this.parser.restrictedConfigurations}}e.UserSettings=l;class d{constructor(n,s,i,r,a,E,v,u,C,U,F,M,z){this.key=n,this.overrides=s,this._value=i,this.overrideIdentifiers=r,this.defaultConfiguration=a,this.policyConfiguration=E,this.applicationConfiguration=v,this.userConfiguration=u,this.localUserConfiguration=C,this.remoteUserConfiguration=U,this.workspaceConfiguration=F,this.folderConfigurationModel=M,this.memoryConfigurationModel=z}get value(){return h(this._value)}inspect(n,s,i){const r=n.inspect(s,i);return{get value(){return h(r.value)},get override(){return h(r.override)},get merged(){return h(r.merged)}}}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.inspect(this.defaultConfiguration,this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.defaultInspectValue.value!==void 0||this.defaultInspectValue.override!==void 0?{value:this.defaultInspectValue.value,override:this.defaultInspectValue.override}:void 0}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.inspect(this.policyConfiguration,this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.inspect(this.applicationConfiguration,this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.applicationInspectValue?.value!==void 0||this.applicationInspectValue?.override!==void 0?{value:this.applicationInspectValue.value,override:this.applicationInspectValue.override}:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.inspect(this.localUserConfiguration,this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.userLocalInspectValue.value!==void 0||this.userLocalInspectValue.override!==void 0?{value:this.userLocalInspectValue.value,override:this.userLocalInspectValue.override}:void 0}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.inspect(this.remoteUserConfiguration,this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.userRemoteInspectValue.value!==void 0||this.userRemoteInspectValue.override!==void 0?{value:this.userRemoteInspectValue.value,override:this.userRemoteInspectValue.override}:void 0}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.inspect(this.workspaceConfiguration,this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.workspaceInspectValue?.value!==void 0||this.workspaceInspectValue?.override!==void 0?{value:this.workspaceInspectValue.value,override:this.workspaceInspectValue.override}:void 0}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.inspect(this.folderConfigurationModel,this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.workspaceFolderInspectValue?.value!==void 0||this.workspaceFolderInspectValue?.override!==void 0?{value:this.workspaceFolderInspectValue.value,override:this.workspaceFolderInspectValue.override}:void 0}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.inspect(this.memoryConfigurationModel,this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.memoryInspectValue.value!==void 0||this.memoryInspectValue.override!==void 0?{value:this.memoryInspectValue.value,override:this.memoryInspectValue.override}:void 0}}class c{constructor(n,s,i,r,a=new f,E=new f,v=new k.ResourceMap,u=new f,C=new k.ResourceMap){this._defaultConfiguration=n,this._policyConfiguration=s,this._applicationConfiguration=i,this._localUserConfiguration=r,this._remoteUserConfiguration=a,this._workspaceConfiguration=E,this._folderConfigurations=v,this._memoryConfiguration=u,this._memoryConfigurationByResource=C,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new k.ResourceMap,this._userConfiguration=null}getValue(n,s,i){return this.getConsolidatedConfigurationModel(n,s,i).getValue(n)}updateValue(n,s,i={}){let r;i.resource?(r=this._memoryConfigurationByResource.get(i.resource),r||(r=new f,this._memoryConfigurationByResource.set(i.resource,r))):r=this._memoryConfiguration,s===void 0?r.removeValue(n):r.setValue(n,s),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(n,s,i){const r=this.getConsolidatedConfigurationModel(n,s,i),a=this.getFolderConfigurationModelForResource(s.resource,i),E=s.resource?this._memoryConfigurationByResource.get(s.resource)||this._memoryConfiguration:this._memoryConfiguration,v=new Set;for(const u of r.overrides)for(const C of u.identifiers)r.getOverrideValue(n,C)!==void 0&&v.add(C);return new d(n,s,r.getValue(n),v.size?[...v]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,a||void 0,E)}keys(n){const s=this.getFolderConfigurationModelForResource(void 0,n);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:s?s.keys.slice(0):[]}}updateDefaultConfiguration(n){this._defaultConfiguration=n,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(n){this._policyConfiguration=n}updateApplicationConfiguration(n){this._applicationConfiguration=n,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(n){this._localUserConfiguration=n,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(n){this._remoteUserConfiguration=n,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(n){this._workspaceConfiguration=n,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(n,s){this._folderConfigurations.set(n,s),this._foldersConsolidatedConfigurations.delete(n)}deleteFolderConfiguration(n){this.folderConfigurations.delete(n),this._foldersConsolidatedConfigurations.delete(n)}compareAndUpdateDefaultConfiguration(n,s){const i=[];if(!s){const{added:r,updated:a,removed:E}=T(this._defaultConfiguration,n);s=[...r,...a,...E]}for(const r of s)for(const a of(0,p.overrideIdentifiersFromKey)(r)){const E=this._defaultConfiguration.getKeysForOverrideIdentifier(a),v=n.getKeysForOverrideIdentifier(a),u=[...v.filter(C=>E.indexOf(C)===-1),...E.filter(C=>v.indexOf(C)===-1),...E.filter(C=>!D.equals(this._defaultConfiguration.override(a).getValue(C),n.override(a).getValue(C)))];i.push([a,u])}return this.updateDefaultConfiguration(n),{keys:s,overrides:i}}compareAndUpdatePolicyConfiguration(n){const{added:s,updated:i,removed:r}=T(this._policyConfiguration,n),a=[...s,...i,...r];return a.length&&this.updatePolicyConfiguration(n),{keys:a,overrides:[]}}compareAndUpdateApplicationConfiguration(n){const{added:s,updated:i,removed:r,overrides:a}=T(this.applicationConfiguration,n),E=[...s,...i,...r];return E.length&&this.updateApplicationConfiguration(n),{keys:E,overrides:a}}compareAndUpdateLocalUserConfiguration(n){const{added:s,updated:i,removed:r,overrides:a}=T(this.localUserConfiguration,n),E=[...s,...i,...r];return E.length&&this.updateLocalUserConfiguration(n),{keys:E,overrides:a}}compareAndUpdateRemoteUserConfiguration(n){const{added:s,updated:i,removed:r,overrides:a}=T(this.remoteUserConfiguration,n),E=[...s,...i,...r];return E.length&&this.updateRemoteUserConfiguration(n),{keys:E,overrides:a}}compareAndUpdateWorkspaceConfiguration(n){const{added:s,updated:i,removed:r,overrides:a}=T(this.workspaceConfiguration,n),E=[...s,...i,...r];return E.length&&this.updateWorkspaceConfiguration(n),{keys:E,overrides:a}}compareAndUpdateFolderConfiguration(n,s){const i=this.folderConfigurations.get(n),{added:r,updated:a,removed:E,overrides:v}=T(i,s),u=[...r,...a,...E];return(u.length||!i)&&this.updateFolderConfiguration(n,s),{keys:u,overrides:v}}compareAndDeleteFolderConfiguration(n){const s=this.folderConfigurations.get(n);if(!s)throw new Error("Unknown folder");this.deleteFolderConfiguration(n);const{added:i,updated:r,removed:a,overrides:E}=T(s,void 0);return{keys:[...i,...r,...a],overrides:E}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(n,s,i){let r=this.getConsolidatedConfigurationModelForResource(s,i);return s.overrideIdentifier&&(r=r.override(s.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(n)!==void 0&&(r=r.merge(this._policyConfiguration)),r}getConsolidatedConfigurationModelForResource({resource:n},s){let i=this.getWorkspaceConsolidatedConfiguration();if(s&&n){const r=s.getFolder(n);r&&(i=this.getFolderConsolidatedConfiguration(r.uri)||i);const a=this._memoryConfigurationByResource.get(n);a&&(i=i.merge(a))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(n){let s=this._foldersConsolidatedConfigurations.get(n);if(!s){const i=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(n);r?(s=i.merge(r),this._foldersConsolidatedConfigurations.set(n,s)):s=i}return s}getFolderConfigurationModelForResource(n,s){if(s&&n){const i=s.getFolder(n);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((n,s)=>{const{contents:i,overrides:r,keys:a}=this._folderConfigurations.get(s);return n.push([s,{contents:i,overrides:r,keys:a}]),n},[])}}allKeys(){const n=new Set;return this._defaultConfiguration.keys.forEach(s=>n.add(s)),this.userConfiguration.keys.forEach(s=>n.add(s)),this._workspaceConfiguration.keys.forEach(s=>n.add(s)),this._folderConfigurations.forEach(s=>s.keys.forEach(i=>n.add(i))),[...n.values()]}allOverrideIdentifiers(){const n=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(s=>n.add(s)),this.userConfiguration.getAllOverrideIdentifiers().forEach(s=>n.add(s)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(s=>n.add(s)),this._folderConfigurations.forEach(s=>s.getAllOverrideIdentifiers().forEach(i=>n.add(i))),[...n.values()]}getAllKeysForOverrideIdentifier(n){const s=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(n).forEach(i=>s.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(n).forEach(i=>s.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(n).forEach(i=>s.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(n).forEach(r=>s.add(r))),[...s.values()]}static parse(n){const s=this.parseConfigurationModel(n.defaults),i=this.parseConfigurationModel(n.policy),r=this.parseConfigurationModel(n.application),a=this.parseConfigurationModel(n.user),E=this.parseConfigurationModel(n.workspace),v=n.folders.reduce((u,C)=>(u.set(S.URI.revive(C[0]),this.parseConfigurationModel(C[1])),u),new k.ResourceMap);return new c(s,i,r,a,new f,E,v,new f,new k.ResourceMap)}static parseConfigurationModel(n){return new f(n.contents,n.keys,n.overrides)}}e.Configuration=c;function m(...o){if(o.length===0)return{keys:[],overrides:[]};if(o.length===1)return o[0];const n=new Set,s=new Map;for(const r of o)r.keys.forEach(a=>n.add(a)),r.overrides.forEach(([a,E])=>{const v=(0,k.getOrSet)(s,a,new Set);E.forEach(u=>v.add(u))});const i=[];return s.forEach((r,a)=>i.push([a,[...r.values()]])),{keys:[...n.values()],overrides:i}}e.mergeChanges=m;class y{constructor(n,s,i,r){this.change=n,this.previous=s,this.currentConfiguraiton=i,this.currentWorkspace=r,this._marker=`
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const a of n.keys)this.affectedKeys.add(a);for(const[,a]of n.overrides)for(const E of a)this.affectedKeys.add(E);this._affectsConfigStr=this._marker;for(const a of this.affectedKeys)this._affectsConfigStr+=a+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=c.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(n,s){const i=this._marker+n,r=this._affectsConfigStr.indexOf(i);if(r<0)return!1;const a=r+i.length;if(a>=this._affectsConfigStr.length)return!1;const E=this._affectsConfigStr.charCodeAt(a);if(E!==this._markerCode1&&E!==this._markerCode2)return!1;if(s){const v=this.previousConfiguration?this.previousConfiguration.getValue(n,s,this.previous?.workspace):void 0,u=this.currentConfiguraiton.getValue(n,s,this.currentWorkspace);return!D.equals(v,u)}return!0}}e.ConfigurationChangeEvent=y;function T(o,n){const{added:s,removed:i,updated:r}=t(n?.rawConfiguration,o?.rawConfiguration),a=[],E=o?.getAllOverrideIdentifiers()||[],v=n?.getAllOverrideIdentifiers()||[];if(n){const u=v.filter(C=>!E.includes(C));for(const C of u)a.push([C,n.getKeysForOverrideIdentifier(C)])}if(o){const u=E.filter(C=>!v.includes(C));for(const C of u)a.push([C,o.getKeysForOverrideIdentifier(C)])}if(n&&o){for(const u of E)if(v.includes(u)){const C=t({contents:o.getOverrideValue(void 0,u)||{},keys:o.getKeysForOverrideIdentifier(u)},{contents:n.getOverrideValue(void 0,u)||{},keys:n.getKeysForOverrideIdentifier(u)});a.push([u,[...C.added,...C.removed,...C.updated]])}}return{added:s,removed:i,updated:r,overrides:a}}function t(o,n){const s=o?n?o.keys.filter(a=>n.keys.indexOf(a)===-1):[...o.keys]:[],i=n?o?n.keys.filter(a=>o.keys.indexOf(a)===-1):[...n.keys]:[],r=[];if(o&&n){for(const a of n.keys)if(o.keys.indexOf(a)!==-1){const E=(0,P.getConfigurationValue)(n.contents,a),v=(0,P.getConfigurationValue)(o.contents,a);D.equals(E,v)||r.push(a)}}return{added:s,removed:i,updated:r}}}),define(ce[208],le([0,1,20,3,2,30,12,73,49,7,56,40]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PolicyConfiguration=e.NullPolicyConfiguration=e.DefaultConfiguration=void 0;class g extends A.Disposable{constructor(){super(...arguments),this._onDidChangeConfiguration=this._register(new O.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=new D.ConfigurationModel}get configurationModel(){return this._configurationModel}async initialize(){return this.resetConfigurationModel(),this._register(p.Registry.as(b.Extensions.Configuration).onDidUpdateConfiguration(({properties:l,defaultsOverrides:d})=>this.onDidUpdateConfiguration(Array.from(l),d))),this.configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}onDidUpdateConfiguration(l,d){this.updateConfigurationModel(l,p.Registry.as(b.Extensions.Configuration).getConfigurationProperties()),this._onDidChangeConfiguration.fire({defaults:this.configurationModel,properties:l})}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new D.ConfigurationModel;const l=p.Registry.as(b.Extensions.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(l),l)}updateConfigurationModel(l,d){const c=this.getConfigurationDefaultOverrides();for(const m of l){const y=c[m],T=d[m];y!==void 0?this._configurationModel.addValue(m,y):T?this._configurationModel.addValue(m,T.default):this._configurationModel.removeValue(m)}}}e.DefaultConfiguration=g;class h{constructor(){this.onDidChangeConfiguration=O.Event.None,this.configurationModel=new D.ConfigurationModel}async initialize(){return this.configurationModel}}e.NullPolicyConfiguration=h;let f=class extends A.Disposable{get configurationModel(){return this._configurationModel}constructor(l,d,c){super(),this.defaultConfiguration=l,this.policyService=d,this.logService=c,this._onDidChangeConfiguration=this._register(new O.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._configurationModel=new D.ConfigurationModel}async initialize(){return this.logService.trace("PolicyConfiguration#initialize"),this.update(await this.updatePolicyDefinitions(this.defaultConfiguration.configurationModel.keys),!1),this._register(this.policyService.onDidChange(l=>this.onDidChangePolicies(l))),this._register(this.defaultConfiguration.onDidChangeConfiguration(async({properties:l})=>this.update(await this.updatePolicyDefinitions(l),!0))),this._configurationModel}async updatePolicyDefinitions(l){this.logService.trace("PolicyConfiguration#updatePolicyDefinitions",l);const d={},c=[],m=p.Registry.as(b.Extensions.Configuration).getConfigurationProperties();for(const y of l){const T=m[y];if(!T){c.push(y);continue}if(T.policy){if(T.type!=="string"&&T.type!=="number"){this.logService.warn(`Policy ${T.policy.name} has unsupported type ${T.type}`);continue}c.push(y),d[T.policy.name]={type:T.type}}}return(0,k.isEmptyObject)(d)||await this.policyService.updatePolicyDefinitions(d),c}onDidChangePolicies(l){this.logService.trace("PolicyConfiguration#onDidChangePolicies",l);const d=p.Registry.as(b.Extensions.Configuration).getPolicyConfigurations(),c=(0,I.coalesce)(l.map(m=>d.get(m)));this.update(c,!0)}update(l,d){this.logService.trace("PolicyConfiguration#update",l);const c=p.Registry.as(b.Extensions.Configuration).getConfigurationProperties(),m=[],y=this._configurationModel.isEmpty();for(const T of l){const t=c[T]?.policy?.name;if(t){const o=this.policyService.getPolicyValue(t);(y?o!==void 0:!(0,_.equals)(this._configurationModel.getValue(T),o))&&m.push([T,o])}else this._configurationModel.getValue(T)!==void 0&&m.push([T,void 0])}if(m.length){this.logService.trace("PolicyConfiguration#changed",m);const T=this._configurationModel;this._configurationModel=new D.ConfigurationModel;for(const t of T.keys)this._configurationModel.setValue(t,T.getValue(t));for(const[t,o]of m)o===void 0?this._configurationModel.removeValue(t):this._configurationModel.setValue(t,o);d&&this._onDidChangeConfiguration.fire(this._configurationModel)}}};e.PolicyConfiguration=f,e.PolicyConfiguration=f=Ee([G(1,P.IPolicyService),G(2,S.ILogService)],f)}),define(ce[209],le([0,1,5,3,2,22,18,73,208,56]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationService=void 0;class P extends A.Disposable{constructor(g,h,f,w){super(),this.settingsResource=g,this._onDidChangeConfiguration=this._register(new O.Emitter),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this.defaultConfiguration=this._register(new b.DefaultConfiguration),this.policyConfiguration=f instanceof S.NullPolicyService?new b.NullPolicyConfiguration:this._register(new b.PolicyConfiguration(this.defaultConfiguration,f,w)),this.userConfiguration=this._register(new D.UserSettings(this.settingsResource,{},_.extUriBiasedIgnorePathCase,h)),this.configuration=new D.Configuration(this.defaultConfiguration.configurationModel,this.policyConfiguration.configurationModel,new D.ConfigurationModel,new D.ConfigurationModel),this.reloadConfigurationScheduler=this._register(new I.RunOnceScheduler(()=>this.reloadConfiguration(),50)),this._register(this.defaultConfiguration.onDidChangeConfiguration(({defaults:l,properties:d})=>this.onDidDefaultConfigurationChange(l,d))),this._register(this.policyConfiguration.onDidChangeConfiguration(l=>this.onDidPolicyConfigurationChange(l))),this._register(this.userConfiguration.onDidChange(()=>this.reloadConfigurationScheduler.schedule()))}async initialize(){const[g,h,f]=await Promise.all([this.defaultConfiguration.initialize(),this.policyConfiguration.initialize(),this.userConfiguration.loadConfiguration()]);this.configuration=new D.Configuration(g,h,new D.ConfigurationModel,f)}getConfigurationData(){return this.configuration.toData()}getValue(g,h){const f=typeof g=="string"?g:void 0,w=(0,k.isConfigurationOverrides)(g)?g:(0,k.isConfigurationOverrides)(h)?h:{};return this.configuration.getValue(f,w,void 0)}updateValue(g,h,f,w){return Promise.reject(new Error("not supported"))}inspect(g){return this.configuration.inspect(g,{},void 0)}keys(){return this.configuration.keys(void 0)}async reloadConfiguration(){const g=await this.userConfiguration.loadConfiguration();this.onDidChangeUserConfiguration(g)}onDidChangeUserConfiguration(g){const h=this.configuration.toData(),f=this.configuration.compareAndUpdateLocalUserConfiguration(g);this.trigger(f,h,2)}onDidDefaultConfigurationChange(g,h){const f=this.configuration.toData(),w=this.configuration.compareAndUpdateDefaultConfiguration(g,h);this.trigger(w,f,7)}onDidPolicyConfigurationChange(g){const h=this.configuration.toData(),f=this.configuration.compareAndUpdatePolicyConfiguration(g);this.trigger(f,h,7)}trigger(g,h,f){const w=new D.ConfigurationChangeEvent(g,{data:h},this.configuration);w.source=f,w.sourceConfig=this.getTargetConfiguration(f),this._onDidChangeConfiguration.fire(w)}getTargetConfiguration(g){switch(g){case 7:return this.configuration.defaults.contents;case 2:return this.configuration.localUserConfiguration.contents}return{}}}e.ConfigurationService=P}),define(ce[210],le([0,1,14,3,2,64]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ManagedSocket=e.connectManagedSocket=e.socketRawEndHeaderSequence=e.makeRawSocketHeaders=void 0;const k=(S,P,p)=>{const g=new Uint8Array(16);for(let w=0;w<16;w++)g[w]=Math.round(Math.random()*256);const h=(0,I.encodeBase64)(I.VSBuffer.wrap(g));return[`GET ws://localhost${S}?${P}&skipWebSocketFrames=true HTTP/1.1`,"Connection: Upgrade","Upgrade: websocket",`Sec-WebSocket-Key: ${h}`].join(`\r
`)+`\r
\r
`};e.makeRawSocketHeaders=k,e.socketRawEndHeaderSequence=I.VSBuffer.fromString(`\r
\r
`);async function D(S,P,p,g,h){S.write(I.VSBuffer.fromString((0,e.makeRawSocketHeaders)(P,p,g)));const f=new A.DisposableStore;try{return await new Promise((w,l)=>{let d;f.add(S.onData(c=>{d?d=I.VSBuffer.concat([d,c],d.byteLength+c.byteLength):d=c;const m=d.indexOf(e.socketRawEndHeaderSequence);if(m===-1)return;w(S),S.pauseData();const y=d.slice(m+e.socketRawEndHeaderSequence.byteLength);y.byteLength&&h.onData.fire(y)})),f.add(S.onClose(c=>l(c??new Error("socket closed")))),f.add(S.onEnd(()=>l(new Error("socket ended"))))})}catch(w){throw S.dispose(),w}finally{f.dispose()}}e.connectManagedSocket=D;class b extends A.Disposable{constructor(P,p){super(),this.debugLabel=P,this.pausableDataEmitter=this._register(new O.PauseableEmitter),this.onData=(...g)=>(this.pausableDataEmitter.isPaused&&queueMicrotask(()=>this.pausableDataEmitter.resume()),this.pausableDataEmitter.event(...g)),this.didDisposeEmitter=this._register(new O.Emitter),this.onDidDispose=this.didDisposeEmitter.event,this.ended=!1,this._register(p.onData),this._register(p.onData.event(g=>this.pausableDataEmitter.fire(g))),this.onClose=this._register(p.onClose).event,this.onEnd=this._register(p.onEnd).event}pauseData(){this.pausableDataEmitter.pause()}drain(){return Promise.resolve()}end(){this.ended=!0,this.closeRemote()}traceSocketEvent(P,p){_.SocketDiagnostics.traceSocketEvent(this,this.debugLabel,P,p)}dispose(){this.ended||this.closeRemote(),this.didDisposeEmitter.fire(),super.dispose()}}e.ManagedSocket=b}),define(ce[211],le([0,1,8,4]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRemoteAuthorityPrefix=e.RemoteAuthorityResolverError=e.RemoteAuthorityResolverErrorCode=e.WebSocketRemoteConnection=e.ManagedRemoteConnection=e.RemoteConnectionType=e.IRemoteAuthorityResolverService=void 0,e.IRemoteAuthorityResolverService=(0,O.createDecorator)("remoteAuthorityResolverService");var A;(function(P){P[P.WebSocket=0]="WebSocket",P[P.Managed=1]="Managed"})(A||(e.RemoteConnectionType=A={}));class _{constructor(p){this.id=p,this.type=1}toString(){return`Managed(${this.id})`}}e.ManagedRemoteConnection=_;class k{constructor(p,g){this.host=p,this.port=g,this.type=0}toString(){return`WebSocket(${this.host}:${this.port})`}}e.WebSocketRemoteConnection=k;var D;(function(P){P.Unknown="Unknown",P.NotAvailable="NotAvailable",P.TemporarilyNotAvailable="TemporarilyNotAvailable",P.NoResolverFound="NoResolverFound",P.InvalidAuthority="InvalidAuthority"})(D||(e.RemoteAuthorityResolverErrorCode=D={}));class b extends I.ErrorNoTelemetry{static isNotAvailable(p){return p instanceof b&&p._code===D.NotAvailable}static isTemporarilyNotAvailable(p){return p instanceof b&&p._code===D.TemporarilyNotAvailable}static isNoResolverFound(p){return p instanceof b&&p._code===D.NoResolverFound}static isInvalidAuthority(p){return p instanceof b&&p._code===D.InvalidAuthority}static isHandled(p){return p instanceof b&&p.isHandled}constructor(p,g=D.Unknown,h){super(p),this._message=p,this._code=g,this._detail=h,this.isHandled=g===D.NotAvailable&&h===!0,Object.setPrototypeOf(this,b.prototype)}}e.RemoteAuthorityResolverError=b;function S(P){const p=P.indexOf("+");return p===-1?P:P.substring(0,p)}e.getRemoteAuthorityPrefix=S}),define(ce[74],le([0,1,26]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseAuthorityWithOptionalPort=e.parseAuthorityWithPort=e.getRemoteServerRootPath=e.getRemoteName=e.getRemoteAuthority=void 0;function O(S){return S.scheme===I.Schemas.vscodeRemote?S.authority:void 0}e.getRemoteAuthority=O;function A(S){if(!S)return;const P=S.indexOf("+");return P<0?S:S.substr(0,P)}e.getRemoteName=A;function _(S){return`/${S.quality??"oss"}-${S.commit??"dev"}`}e.getRemoteServerRootPath=_;function k(S){const{host:P,port:p}=b(S);if(typeof p>"u")throw new Error("Remote authority doesn't contain a port!");return{host:P,port:p}}e.parseAuthorityWithPort=k;function D(S,P){let{host:p,port:g}=b(S);return typeof g>"u"&&(g=P),{host:p,port:g}}e.parseAuthorityWithOptionalPort=D;function b(S){const P=S.match(/^(\[[0-9a-z:]+\]):(\d+)$/);if(P)return{host:P[1],port:parseInt(P[2],10)};const p=S.match(/^(\[[0-9a-z:]+\])$/);if(p)return{host:p[1],port:void 0};const g=S.match(/(.*):(\d+)$/);return g?{host:g[1],port:parseInt(g[2],10)}:{host:S,port:void 0}}}),define(ce[41],le([0,1,28,4,74]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBuiltinExtensionsScannerService=e.isResolverExtension=e.isAuthenticationProviderExtension=e.isLanguagePackExtension=e.isApplicationScopedExtension=e.ExtensionIdentifierMap=e.ExtensionIdentifierSet=e.ExtensionIdentifier=e.TargetPlatform=e.ExtensionType=e.EXTENSION_CATEGORIES=e.getWorkspaceSupportTypeMessage=e.ALL_EXTENSION_KINDS=e.ExtensionsPolicy=e.ExtensionsPolicyKey=e.UNDEFINED_PUBLISHER=e.BUILTIN_MANIFEST_CACHE_FILE=e.USER_MANIFEST_CACHE_FILE=void 0,e.USER_MANIFEST_CACHE_FILE="extensions.user.cache",e.BUILTIN_MANIFEST_CACHE_FILE="extensions.builtin.cache",e.UNDEFINED_PUBLISHER="undefined_publisher",e.ExtensionsPolicyKey="extensions.extensionsPolicy";var _;(function(l){l.allowAll="allowAll",l.allowNone="allowNone",l.allowMicrosoft="allowMicrosoft"})(_||(e.ExtensionsPolicy=_={})),e.ALL_EXTENSION_KINDS=["ui","workspace","web"];function k(l){if(typeof l=="object"&&l!==null&&l.supported!==!0)return l.description}e.getWorkspaceSupportTypeMessage=k,e.EXTENSION_CATEGORIES=["Language Packs"];var D;(function(l){l[l.System=0]="System",l[l.User=1]="User"})(D||(e.ExtensionType=D={}));var b;(function(l){l.WIN32_X64="win32-x64",l.WIN32_IA32="win32-ia32",l.WIN32_ARM64="win32-arm64",l.LINUX_X64="linux-x64",l.LINUX_ARM64="linux-arm64",l.LINUX_ARMHF="linux-armhf",l.ALPINE_X64="alpine-x64",l.ALPINE_ARM64="alpine-arm64",l.DARWIN_X64="darwin-x64",l.DARWIN_ARM64="darwin-arm64",l.WEB="web",l.UNIVERSAL="universal",l.UNKNOWN="unknown",l.UNDEFINED="undefined"})(b||(e.TargetPlatform=b={}));class S{constructor(d){this.value=d,this._lower=d.toLowerCase()}static equals(d,c){if(typeof d>"u"||d===null)return typeof c>"u"||c===null;if(typeof c>"u"||c===null)return!1;if(typeof d=="string"||typeof c=="string"){const m=typeof d=="string"?d:d.value,y=typeof c=="string"?c:c.value;return I.equalsIgnoreCase(m,y)}return d._lower===c._lower}static toKey(d){return typeof d=="string"?d.toLowerCase():d._lower}}e.ExtensionIdentifier=S;class P{get size(){return this._set.size}constructor(d){if(this._set=new Set,d)for(const c of d)this.add(c)}add(d){this._set.add(S.toKey(d))}delete(d){return this._set.delete(S.toKey(d))}has(d){return this._set.has(S.toKey(d))}}e.ExtensionIdentifierSet=P;class p{constructor(){this._map=new Map}clear(){this._map.clear()}delete(d){this._map.delete(S.toKey(d))}get(d){return this._map.get(S.toKey(d))}has(d){return this._map.has(S.toKey(d))}set(d,c){this._map.set(S.toKey(d),c)}values(){return this._map.values()}forEach(d){this._map.forEach(d)}[Symbol.iterator](){return this._map[Symbol.iterator]()}}e.ExtensionIdentifierMap=p;function g(l){return h(l)}e.isApplicationScopedExtension=g;function h(l){return l.contributes&&l.contributes.localizations?l.contributes.localizations.length>0:!1}e.isLanguagePackExtension=h;function f(l){return l.contributes&&l.contributes.authentication?l.contributes.authentication.length>0:!1}e.isAuthenticationProviderExtension=f;function w(l,d){if(d){const c=`onResolveRemoteAuthority:${(0,A.getRemoteName)(d)}`;return!!l.activationEvents?.includes(c)}return!1}e.isResolverExtension=w,e.IBuiltinExtensionsScannerService=(0,O.createDecorator)("IBuiltinExtensionsScannerService")}),define(ce[212],le([0,1,2,41,13]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsManifestCache=void 0;class _ extends I.Disposable{constructor(D,b,S,P,p){super(),this.userDataProfilesService=D,this.fileService=b,this.uriIdentityService=S,this.logService=p,this._register(P.onDidInstallExtensions(g=>this.onDidInstallExtensions(g))),this._register(P.onDidUninstallExtension(g=>this.onDidUnInstallExtension(g)))}onDidInstallExtensions(D){for(const b of D)b.local&&this.invalidate(b.profileLocation)}onDidUnInstallExtension(D){D.error||this.invalidate(D.profileLocation)}async invalidate(D){if(D)for(const b of this.userDataProfilesService.profiles)this.uriIdentityService.extUri.isEqual(b.extensionsResource,D)&&await this.deleteUserCacheFile(b);else await this.deleteUserCacheFile(this.userDataProfilesService.defaultProfile)}async deleteUserCacheFile(D){try{await this.fileService.del(this.uriIdentityService.extUri.joinPath(D.cacheHome,O.USER_MANIFEST_CACHE_FILE))}catch(b){(0,A.toFileOperationResult)(b)!==1&&this.logService.error(b)}}}e.ExtensionsManifestCache=_}),define(ce[213],le([0,1,5,14,25,8,3,2,102,89,32,64,211,74]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionHostPersistentConnection=e.ManagementPersistentConnection=e.PersistentConnection=e.ReconnectionPermanentFailureEvent=e.ConnectionGainEvent=e.ReconnectionRunningEvent=e.ReconnectionWaitEvent=e.ConnectionLostEvent=e.PersistentConnectionEventType=e.connectRemoteAgentTunnel=e.connectRemoteAgentExtensionHost=e.connectRemoteAgentManagement=e.ConnectionType=void 0;const f=30*1e3;var w;(function($){$[$.Management=1]="Management",$[$.ExtensionHost=2]="ExtensionHost",$[$.Tunnel=3]="Tunnel"})(w||(e.ConnectionType=w={}));function l($){switch($){case 1:return"Management";case 2:return"ExtensionHost";case 3:return"Tunnel"}}function d($){const R=new A.CancellationTokenSource;return setTimeout(()=>R.cancel(),$),R.token}function c($,R){if($.isCancellationRequested||R.isCancellationRequested)return A.CancellationToken.Cancelled;const L=new A.CancellationTokenSource;return $.onCancellationRequested(()=>L.cancel()),R.onCancellationRequested(()=>L.cancel()),L.token}class m{get didTimeout(){return this._state==="timedout"}constructor(R){this._state="pending",this._disposables=new D.DisposableStore,this.promise=new Promise((L,N)=>{this._resolvePromise=L,this._rejectPromise=N}),R.isCancellationRequested?this._timeout():this._disposables.add(R.onCancellationRequested(()=>this._timeout()))}registerDisposable(R){this._state==="pending"?this._disposables.add(R):R.dispose()}_timeout(){this._state==="pending"&&(this._disposables.dispose(),this._state="timedout",this._rejectPromise(this._createTimeoutError()))}_createTimeoutError(){const R=new Error("Time limit reached");return R.code="ETIMEDOUT",R.syscall="connect",R}resolve(R){this._state==="pending"&&(this._disposables.dispose(),this._state="resolved",this._resolvePromise(R))}reject(R){this._state==="pending"&&(this._disposables.dispose(),this._state="rejected",this._rejectPromise(R))}}function y($,R){const L=new m(R);return L.registerDisposable($.onControlMessage(N=>{const W=JSON.parse(N.toString()),X=q(W);X?L.reject(X):L.resolve(W)})),L.promise}function T($,R,L,N,W,X,ne,re){const Q=new m(re),ee=S.StopWatch.create(!1);return $.info(`Creating a socket (${ne})...`),b.mark(`code/willCreateSocket/${X}`),R.connect(L,N,W,ne).then(ie=>{Q.didTimeout?(b.mark(`code/didCreateSocketError/${X}`),$.info(`Creating a socket (${ne}) finished after ${ee.elapsed()} ms, but this is too late and has timed out already.`),ie?.dispose()):(b.mark(`code/didCreateSocketOK/${X}`),$.info(`Creating a socket (${ne}) was successful after ${ee.elapsed()} ms.`),Q.resolve(ie))},ie=>{b.mark(`code/didCreateSocketError/${X}`),$.info(`Creating a socket (${ne}) returned an error after ${ee.elapsed()} ms.`),$.error(ie),Q.reject(ie)}),Q.promise}function t($,R){const L=new m(R);return $.then(N=>{L.didTimeout||L.resolve(N)},N=>{L.didTimeout||L.reject(N)}),L.promise}async function o($,R,L,N){const W=ue($,R);$.logService.trace(`${W} 1/6. invoking socketFactory.connect().`);let X;try{X=await T($.logService,$.remoteSocketFactoryService,$.connectTo,(0,h.getRemoteServerRootPath)($),`reconnectionToken=${$.reconnectionToken}&reconnection=${$.reconnectionProtocol?"true":"false"}`,l(R),`renderer-${l(R)}-${$.reconnectionToken}`,N)}catch(ie){throw $.logService.error(`${W} socketFactory.connect() failed or timed out. Error:`),$.logService.error(ie),ie}$.logService.trace(`${W} 2/6. socketFactory.connect() was successful.`);let ne,re;$.reconnectionProtocol?($.reconnectionProtocol.beginAcceptReconnection(X,null),ne=$.reconnectionProtocol,re=!1):(ne=new p.PersistentProtocol({socket:X}),re=!0),$.logService.trace(`${W} 3/6. sending AuthRequest control message.`);const Q=await t($.signService.createNewMessage((0,P.generateUuid)()),N),ee={type:"auth",auth:$.connectionToken||"00000000000000000000",data:Q.data};ne.sendControl(O.VSBuffer.fromString(JSON.stringify(ee)));try{const ie=await y(ne,c(N,d(1e4)));if(ie.type!=="sign"||typeof ie.data!="string"){const ye=new Error("Unexpected handshake message");throw ye.code="VSCODE_CONNECTION_ERROR",ye}if($.logService.trace(`${W} 4/6. received SignRequest control message.`),!await t($.signService.validate(Q,ie.signedData),N)){const ye=new Error("Refused to connect to unsupported server");throw ye.code="VSCODE_CONNECTION_ERROR",ye}const fe=await t($.signService.sign(ie.data),N),pe={type:"connectionType",commit:$.commit,signedData:fe,desiredConnectionType:R};return L&&(pe.args=L),$.logService.trace(`${W} 5/6. sending ConnectionTypeRequest control message.`),ne.sendControl(O.VSBuffer.fromString(JSON.stringify(pe))),{protocol:ne,ownsProtocol:re}}catch(ie){throw ie&&ie.code==="ETIMEDOUT"&&($.logService.error(`${W} the handshake timed out. Error:`),$.logService.error(ie)),ie&&ie.code==="VSCODE_CONNECTION_ERROR"&&($.logService.error(`${W} received error control message when negotiating connection. Error:`),$.logService.error(ie)),re&&x(ne),ie}}async function n($,R,L,N){const W=Date.now(),X=ue($,R),{protocol:ne,ownsProtocol:re}=await o($,R,L,N),Q=new m(N);return Q.registerDisposable(ne.onControlMessage(ee=>{const ie=JSON.parse(ee.toString()),de=q(ie);de?($.logService.error(`${X} received error control message when negotiating connection. Error:`),$.logService.error(de),re&&x(ne),Q.reject(de)):($.reconnectionProtocol?.endAcceptReconnection(),$.logService.trace(`${X} 6/6. handshake finished, connection is up and running after ${ae(W)}!`),Q.resolve({protocol:ne,firstMessage:ie}))})),Q.promise}async function s($,R){const{protocol:L}=await n($,1,void 0,R);return{protocol:L}}async function i($,R,L){const{protocol:N,firstMessage:W}=await n($,2,R,L),X=W&&W.debugPort;return{protocol:N,debugPort:X}}async function r($,R,L){const N=Date.now(),W=ue($,3),{protocol:X}=await o($,3,R,L);return $.logService.trace(`${W} 6/6. handshake finished, connection is up and running after ${ae(N)}!`),X}async function a($,R,L){const{connectTo:N,connectionToken:W}=await $.addressProvider.getAddress();return{commit:$.commit,quality:$.quality,connectTo:N,connectionToken:W,reconnectionToken:R,reconnectionProtocol:L,remoteSocketFactoryService:$.remoteSocketFactoryService,signService:$.signService,logService:$.logService}}async function E($,R,L){return u($,async N=>{const{protocol:W}=await s(N,A.CancellationToken.None);return new B($,R,L,N.reconnectionToken,W)})}e.connectRemoteAgentManagement=E;async function v($,R){return u($,async L=>{const{protocol:N,debugPort:W}=await i(L,R,A.CancellationToken.None);return new K($,R,L.reconnectionToken,N,W)})}e.connectRemoteAgentExtensionHost=v;async function u($,R){for(let N=1;;N++)try{const W=(0,P.generateUuid)(),X=await a($,W,null);return await R(X)}catch(W){if(N<5)$.logService.error(`[remote-connection][attempt ${N}] An error occurred in initial connection! Will retry... Error:`),$.logService.error(W);else throw $.logService.error(`[remote-connection][attempt ${N}]  An error occurred in initial connection! It will be treated as a permanent error. Error:`),$.logService.error(W),Y.triggerPermanentFailure(0,0,g.RemoteAuthorityResolverError.isHandled(W)),W}}async function C($,R,L){const N=await a($,(0,P.generateUuid)(),null);return await r(N,{host:R,port:L},A.CancellationToken.None)}e.connectRemoteAgentTunnel=C;function U($){return(0,I.createCancelablePromise)(R=>new Promise((L,N)=>{const W=setTimeout(L,$*1e3);R.onCancellationRequested(()=>{clearTimeout(W),L()})}))}var F;(function($){$[$.ConnectionLost=0]="ConnectionLost",$[$.ReconnectionWait=1]="ReconnectionWait",$[$.ReconnectionRunning=2]="ReconnectionRunning",$[$.ReconnectionPermanentFailure=3]="ReconnectionPermanentFailure",$[$.ConnectionGain=4]="ConnectionGain"})(F||(e.PersistentConnectionEventType=F={}));class M{constructor(R,L){this.reconnectionToken=R,this.millisSinceLastIncomingData=L,this.type=0}}e.ConnectionLostEvent=M;class z{constructor(R,L,N,W){this.reconnectionToken=R,this.millisSinceLastIncomingData=L,this.durationSeconds=N,this.cancellableTimer=W,this.type=1}skipWait(){this.cancellableTimer.cancel()}}e.ReconnectionWaitEvent=z;class V{constructor(R,L,N){this.reconnectionToken=R,this.millisSinceLastIncomingData=L,this.attempt=N,this.type=2}}e.ReconnectionRunningEvent=V;class J{constructor(R,L,N){this.reconnectionToken=R,this.millisSinceLastIncomingData=L,this.attempt=N,this.type=4}}e.ConnectionGainEvent=J;class H{constructor(R,L,N,W){this.reconnectionToken=R,this.millisSinceLastIncomingData=L,this.attempt=N,this.handled=W,this.type=3}}e.ReconnectionPermanentFailureEvent=H;class Y extends D.Disposable{static triggerPermanentFailure(R,L,N){this._permanentFailure=!0,this._permanentFailureMillisSinceLastIncomingData=R,this._permanentFailureAttempt=L,this._permanentFailureHandled=N,this._instances.forEach(W=>W._gotoPermanentFailure(this._permanentFailureMillisSinceLastIncomingData,this._permanentFailureAttempt,this._permanentFailureHandled))}static debugTriggerReconnection(){this._instances.forEach(R=>R._beginReconnecting())}static debugPauseSocketWriting(){this._instances.forEach(R=>R._pauseSocketWriting())}static{this._permanentFailure=!1}static{this._permanentFailureMillisSinceLastIncomingData=0}static{this._permanentFailureAttempt=0}static{this._permanentFailureHandled=!1}static{this._instances=[]}get _isPermanentFailure(){return this._permanentFailure||Y._permanentFailure}constructor(R,L,N,W,X){super(),this._connectionType=R,this._options=L,this.reconnectionToken=N,this.protocol=W,this._reconnectionFailureIsFatal=X,this._onDidStateChange=this._register(new k.Emitter),this.onDidStateChange=this._onDidStateChange.event,this._permanentFailure=!1,this._isReconnecting=!1,this._isDisposed=!1,this._onDidStateChange.fire(new J(this.reconnectionToken,0,0)),this._register(W.onSocketClose(ne=>{const re=oe(this._connectionType,this.reconnectionToken,!0);ne?ne.type===0?(this._options.logService.info(`${re} received socket close event (hadError: ${ne.hadError}).`),ne.error&&this._options.logService.error(ne.error)):(this._options.logService.info(`${re} received socket close event (wasClean: ${ne.wasClean}, code: ${ne.code}, reason: ${ne.reason}).`),ne.event&&this._options.logService.error(ne.event)):this._options.logService.info(`${re} received socket close event.`),this._beginReconnecting()})),this._register(W.onSocketTimeout(ne=>{const re=oe(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${re} received socket timeout event (unacknowledgedMsgCount: ${ne.unacknowledgedMsgCount}, timeSinceOldestUnacknowledgedMsg: ${ne.timeSinceOldestUnacknowledgedMsg}, timeSinceLastReceivedSomeData: ${ne.timeSinceLastReceivedSomeData}).`),this._beginReconnecting()})),Y._instances.push(this),this._register((0,D.toDisposable)(()=>{const ne=Y._instances.indexOf(this);ne>=0&&Y._instances.splice(ne,1)})),this._isPermanentFailure&&this._gotoPermanentFailure(Y._permanentFailureMillisSinceLastIncomingData,Y._permanentFailureAttempt,Y._permanentFailureHandled)}dispose(){super.dispose(),this._isDisposed=!0}async _beginReconnecting(){if(!this._isReconnecting)try{this._isReconnecting=!0,await this._runReconnectingLoop()}finally{this._isReconnecting=!1}}async _runReconnectingLoop(){if(this._isPermanentFailure||this._isDisposed)return;const R=oe(this._connectionType,this.reconnectionToken,!0);this._options.logService.info(`${R} starting reconnecting loop. You can get more information with the trace log level.`),this._onDidStateChange.fire(new M(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData()));const L=[0,5,5,10,10,10,10,10,30];let N=-1;do{N++;const W=N<L.length?L[N]:L[L.length-1];try{if(W>0){const ne=U(W);this._onDidStateChange.fire(new z(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),W,ne)),this._options.logService.info(`${R} waiting for ${W} seconds before reconnecting...`);try{await ne}catch{}}if(this._isPermanentFailure){this._options.logService.error(`${R} permanent failure occurred while running the reconnecting loop.`);break}this._onDidStateChange.fire(new V(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),N+1)),this._options.logService.info(`${R} resolving connection...`);const X=await a(this._options,this.reconnectionToken,this.protocol);this._options.logService.info(`${R} connecting to ${X.connectTo}...`),await this._reconnect(X,d(f)),this._options.logService.info(`${R} reconnected!`),this._onDidStateChange.fire(new J(this.reconnectionToken,this.protocol.getMillisSinceLastIncomingData(),N+1));break}catch(X){if(X.code==="VSCODE_CONNECTION_ERROR"){this._options.logService.error(`${R} A permanent error occurred in the reconnecting loop! Will give up now! Error:`),this._options.logService.error(X),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),N+1,!1);break}if(N>360){this._options.logService.error(`${R} An error occurred while reconnecting, but it will be treated as a permanent error because the reconnection grace time has expired! Will give up now! Error:`),this._options.logService.error(X),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),N+1,!1);break}if(g.RemoteAuthorityResolverError.isTemporarilyNotAvailable(X)){this._options.logService.info(`${R} A temporarily not available error occurred while trying to reconnect, will try again...`),this._options.logService.trace(X);continue}if((X.code==="ETIMEDOUT"||X.code==="ENETUNREACH"||X.code==="ECONNREFUSED"||X.code==="ECONNRESET")&&X.syscall==="connect"){this._options.logService.info(`${R} A network error occurred while trying to reconnect, will try again...`),this._options.logService.trace(X);continue}if((0,_.isCancellationError)(X)){this._options.logService.info(`${R} A promise cancelation error occurred while trying to reconnect, will try again...`),this._options.logService.trace(X);continue}if(X instanceof g.RemoteAuthorityResolverError){this._options.logService.error(`${R} A RemoteAuthorityResolverError occurred while trying to reconnect. Will give up now! Error:`),this._options.logService.error(X),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),N+1,g.RemoteAuthorityResolverError.isHandled(X));break}this._options.logService.error(`${R} An unknown error occurred while trying to reconnect, since this is an unknown case, it will be treated as a permanent error! Will give up now! Error:`),this._options.logService.error(X),this._onReconnectionPermanentFailure(this.protocol.getMillisSinceLastIncomingData(),N+1,!1);break}}while(!this._isPermanentFailure&&!this._isDisposed)}_onReconnectionPermanentFailure(R,L,N){this._reconnectionFailureIsFatal?Y.triggerPermanentFailure(R,L,N):this._gotoPermanentFailure(R,L,N)}_gotoPermanentFailure(R,L,N){this._onDidStateChange.fire(new H(this.reconnectionToken,R,L,N)),x(this.protocol)}_pauseSocketWriting(){this.protocol.pauseSocketWriting()}}e.PersistentConnection=Y;class B extends Y{constructor(R,L,N,W,X){super(1,R,W,X,!0),this.client=this._register(new p.Client(X,{remoteAuthority:L,clientId:N},R.ipcLogger))}async _reconnect(R,L){await s(R,L)}}e.ManagementPersistentConnection=B;class K extends Y{constructor(R,L,N,W,X){super(2,R,N,W,!1),this._startArguments=L,this.debugPort=X}async _reconnect(R,L){await i(R,this._startArguments,L)}}e.ExtensionHostPersistentConnection=K;function x($){try{$.acceptDisconnect();const R=$.getSocket();$.dispose(),R.dispose()}catch(R){(0,_.onUnexpectedError)(R)}}function q($){if($&&$.type==="error"){const R=new Error(`Connection error: ${$.reason}`);return R.code="VSCODE_CONNECTION_ERROR",R}return null}function j($,R){for(;$.length<R;)$+=" ";return $}function Z($,R){return`[remote-connection][${j(l($),13)}][${R.substr(0,5)}\u2026]`}function oe($,R,L){return`${Z($,R)}[${L?"reconnect":"initial"}]`}function ue($,R){return`${oe(R,$.reconnectionToken,!!$.reconnectionProtocol)}[${$.connectTo}]`}function ae($){return`${Date.now()-$} ms`}}),define(ce[105],le([0,1,2,4]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteSocketFactoryService=e.IRemoteSocketFactoryService=void 0,e.IRemoteSocketFactoryService=(0,O.createDecorator)("remoteSocketFactoryService");class A{constructor(){this.factories={}}register(k,D){return this.factories[k]??=[],this.factories[k].push(D),(0,I.toDisposable)(()=>{const b=this.factories[k]?.indexOf(D);typeof b=="number"&&b>=0&&this.factories[k]?.splice(b,1)})}getSocketFactory(k){return(this.factories[k.type]||[]).find(b=>b.supports(k))}connect(k,D,b,S){const P=this.getSocketFactory(k);if(!P)throw new Error(`No socket factory found for ${k}`);return P.connect(k,D,b,S)}}e.RemoteSocketFactoryService=A}),define(ce[214],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ipcSharedProcessTunnelChannelName=e.ISharedProcessTunnelService=void 0,e.ISharedProcessTunnelService=(0,I.createDecorator)("sharedProcessTunnelService"),e.ipcSharedProcessTunnelChannelName="sharedProcessTunnel"}),define(ce[106],le([0,1,4,164]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LOGGER_NAME=e.LOG_ID=e.CONFIGURATION_KEY_PREVENT_SLEEP=e.CONFIGURATION_KEY_HOST_NAME=e.CONFIGURATION_KEY_PREFIX=e.TunnelStates=e.INACTIVE_TUNNEL_MODE=e.IRemoteTunnelService=void 0,e.IRemoteTunnelService=(0,I.createDecorator)("IRemoteTunnelService"),e.INACTIVE_TUNNEL_MODE={active:!1};var A;(function(_){_.disconnected=k=>({type:"disconnected",onTokenFailed:k}),_.connected=(k,D)=>({type:"connected",info:k,serviceInstallFailed:D}),_.connecting=k=>({type:"connecting",progress:k}),_.uninitialized={type:"uninitialized"}})(A||(e.TunnelStates=A={})),e.CONFIGURATION_KEY_PREFIX="remote.tunnels.access",e.CONFIGURATION_KEY_HOST_NAME=e.CONFIGURATION_KEY_PREFIX+".hostNameOverride",e.CONFIGURATION_KEY_PREVENT_SLEEP=e.CONFIGURATION_KEY_PREFIX+".preventSleep",e.LOG_ID="remoteTunnelService",e.LOGGER_NAME=(0,O.localize)(0,null)}),define(ce[57],le([0,1,14,8,2,166,49,4,7,40]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.updateProxyConfigurationsScope=e.asJson=e.asTextOrError=e.asText=e.isSuccess=e.AbstractRequestService=e.IRequestService=void 0,e.IRequestService=(0,D.createDecorator)("requestService");class P{constructor(T){this.original=T}toJSON(){if(!this.headers){const T=Object.create(null);for(const t in this.original)t.toLowerCase()==="authorization"||t.toLowerCase()==="proxy-authorization"?T[t]="*****":T[t]=this.original[t];this.headers=T}return this.headers}}class p extends A.Disposable{constructor(T){super(),this.counter=0,this.logger=T.createLogger("network",{name:(0,_.localize)(0,null),when:b.CONTEXT_LOG_LEVEL.isEqualTo((0,b.LogLevelToString)(b.LogLevel.Trace)).serialize()})}async logAndRequest(T,t,o){const n=`${T} #${++this.counter}: ${t.url}`;this.logger.trace(`${n} - begin`,t.type,new P(t.headers??{}));try{const s=await o();return this.logger.trace(`${n} - end`,t.type,s.res.statusCode,s.res.headers),s}catch(s){throw this.logger.error(`${n} - error`,t.type,(0,O.getErrorMessage)(s)),s}}}e.AbstractRequestService=p;function g(y){return y.res.statusCode&&y.res.statusCode>=200&&y.res.statusCode<300||y.res.statusCode===1223}e.isSuccess=g;function h(y){return y.res.statusCode===204}async function f(y){return h(y)?null:(await(0,I.streamToBuffer)(y.stream)).toString()}e.asText=f;async function w(y){if(!g(y))throw new Error("Server returned "+y.res.statusCode);return f(y)}e.asTextOrError=w;async function l(y){if(!g(y))throw new Error("Server returned "+y.res.statusCode);if(h(y))return null;const t=(await(0,I.streamToBuffer)(y.stream)).toString();try{return JSON.parse(t)}catch(o){throw o.message+=`:
`+t,o}}e.asJson=l;function d(y){m(y)}e.updateProxyConfigurationsScope=d;let c;function m(y){const T=S.Registry.as(k.Extensions.Configuration),t=c;c={id:"http",order:15,title:(0,_.localize)(1,null),type:"object",scope:y,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:(0,_.localize)(2,null),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,description:(0,_.localize)(3,null),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:(0,_.localize)(4,null),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:(0,_.localize)(5,null),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[(0,_.localize)(6,null),(0,_.localize)(7,null),(0,_.localize)(8,null),(0,_.localize)(9,null)],default:"override",description:(0,_.localize)(10,null),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,description:(0,_.localize)(11,null),restricted:!0}}},T.updateConfigurations({add:[c],remove:t?[t]:[]})}m(1)}),define(ce[215],le([0,1,25,26,13,57]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DownloadService=void 0;let k=class{constructor(b,S){this.requestService=b,this.fileService=S}async download(b,S,P=I.CancellationToken.None){if(b.scheme===O.Schemas.file||b.scheme===O.Schemas.vscodeRemote){await this.fileService.copy(b,S);return}const p={type:"GET",url:b.toString(!0)},g=await this.requestService.request(p,P);if(g.res.statusCode===200)await this.fileService.writeFile(S,g.stream);else{const h=await(0,_.asTextOrError)(g);throw new Error(`Expected 200, got back ${g.res.statusCode} instead.

${h}`)}}};e.DownloadService=k,e.DownloadService=k=Ee([G(0,_.IRequestService),G(1,A.IFileService)],k)}),define(ce[216],le([0,1,14,25]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RequestChannelClient=e.RequestChannel=void 0;class A{constructor(D){this.service=D}listen(D,b){throw new Error("Invalid listen")}call(D,b,S,P=O.CancellationToken.None){switch(b){case"request":return this.service.request(S[0],P).then(async({res:p,stream:g})=>{const h=await(0,I.streamToBuffer)(g);return[{statusCode:p.statusCode,headers:p.headers},h]});case"resolveProxy":return this.service.resolveProxy(S[0])}throw new Error("Invalid call")}}e.RequestChannel=A;class _{constructor(D){this.channel=D}async request(D,b){const[S,P]=await this.channel.call("request",[D],b);return{res:S,stream:(0,I.bufferToStream)(P)}}async resolveProxy(D){return this.channel.call("resolveProxy",[D])}}e.RequestChannelClient=_}),define(ce[217],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedProcessRawConnection=e.SharedProcessChannelConnection=e.SharedProcessLifecycle=void 0,e.SharedProcessLifecycle={exit:"vscode:electron-main->shared-process=exit",ipcReady:"vscode:shared-process->electron-main=ipc-ready",initDone:"vscode:shared-process->electron-main=init-done"},e.SharedProcessChannelConnection={request:"vscode:createSharedProcessChannelConnection",response:"vscode:createSharedProcessChannelConnectionResult"},e.SharedProcessRawConnection={request:"vscode:createSharedProcessRawConnection",response:"vscode:createSharedProcessRawConnectionResult"}}),define(ce[218],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractSignService=void 0;class I{constructor(){this.validators=new Map}static{this._nextId=1}async createNewMessage(A){try{const _=await this.getValidator();if(_){const k=String(I._nextId++);return this.validators.set(k,_),{id:k,data:_.createNewMessage(A)}}}catch{}return{id:"",data:A}}async validate(A,_){if(!A.id)return!0;const k=this.validators.get(A.id);if(!k)return!1;this.validators.delete(A.id);try{return k.validate(_)==="ok"}catch{return!1}finally{k.dispose?.()}}async sign(A){try{return await this.signValue(A)}catch{}return A}}e.AbstractSignService=I}),define(ce[107],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ISignService=e.SIGN_SERVICE_ID=void 0,e.SIGN_SERVICE_ID="signService",e.ISignService=(0,I.createDecorator)(e.SIGN_SERVICE_ID)}),define(ce[219],le([0,1,218]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SignService=void 0;class O extends I.AbstractSignService{getValidator(){return this.vsda().then(_=>new _.validator)}signValue(_){return this.vsda().then(k=>new k.signer().sign(_))}vsda(){return new Promise((_,k)=>te(["vsda"],_,k))}}e.SignService=O}),define(ce[75],le([0,1,3,2]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StorageClient=e.WorkspaceStorageDatabaseClient=e.ProfileStorageDatabaseClient=e.ApplicationStorageDatabaseClient=void 0;class A extends O.Disposable{constructor(p,g,h){super(),this.channel=p,this.profile=g,this.workspace=h}async getItems(){const p={profile:this.profile,workspace:this.workspace},g=await this.channel.call("getItems",p);return new Map(g)}updateItems(p){const g={profile:this.profile,workspace:this.workspace};return p.insert&&(g.insert=Array.from(p.insert.entries())),p.delete&&(g.delete=Array.from(p.delete.values())),this.channel.call("updateItems",g)}}class _ extends A{constructor(p,g){super(p,g,void 0),this._onDidChangeItemsExternal=this._register(new I.Emitter),this.onDidChangeItemsExternal=this._onDidChangeItemsExternal.event,this.registerListeners()}registerListeners(){this._register(this.channel.listen("onDidChangeStorage",{profile:this.profile})(p=>this.onDidChangeStorage(p)))}onDidChangeStorage(p){(Array.isArray(p.changed)||Array.isArray(p.deleted))&&this._onDidChangeItemsExternal.fire({changed:p.changed?new Map(p.changed):void 0,deleted:p.deleted?new Set(p.deleted):void 0})}}class k extends _{constructor(p){super(p,void 0)}async close(){this.dispose()}}e.ApplicationStorageDatabaseClient=k;class D extends _{constructor(p,g){super(p,g)}async close(){this.dispose()}}e.ProfileStorageDatabaseClient=D;class b extends A{constructor(p,g){super(p,void 0,g),this.onDidChangeItemsExternal=I.Event.None}async close(){this.dispose()}}e.WorkspaceStorageDatabaseClient=b;class S{constructor(p){this.channel=p}isUsed(p){const g={payload:p,profile:void 0,workspace:void 0};return this.channel.call("isUsed",g)}}e.StorageClient=S}),define(ce[108],le([0,1,6,37,32,72]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.verifyMicrosoftInternalDomain=e.resolveCommonProperties=void 0;const k=_.default;function D(P){if(I.platform===2&&/^penguin(\.|$)/i.test(P))return"chromebook"}function b(P,p,g,h,f,w,l,d){const c=Object.create(null);c["common.machineId"]=w,c.sessionID=(0,A.generateUuid)()+Date.now(),c.commitHash=h,c.version=f,c["common.platformVersion"]=(P||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),c["common.platform"]=(0,I.PlatformToString)(I.platform),c["common.nodePlatform"]=O.platform,c["common.nodeArch"]=g,c["common.product"]=k.nameShort||"desktop",c["common.application.name"]=k.nameLong,c.quality=k.quality||"dev",l&&(c["common.msftInternal"]=l);let m=0;const y=Date.now();Object.defineProperties(c,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-y,enumerable:!0},"common.sequence":{get:()=>m++,enumerable:!0}}),I.isLinuxSnap&&(c["common.snap"]="true");const T=D(p);return T&&(c["common.platformDetail"]=T),c}e.resolveCommonProperties=b;function S(P){const p=O.env.USERDNSDOMAIN;if(!p)return!1;const g=p.toLowerCase();return P.some(h=>g===h)}e.verifyMicrosoftInternalDomain=S}),define(ce[21],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryConfiguration=e.TelemetryLevel=e.TELEMETRY_OLD_SETTING_ID=e.TELEMETRY_CRASH_REPORTER_SETTING_ID=e.TELEMETRY_SETTING_ID=e.TELEMETRY_SECTION_ID=e.machineIdKey=e.lastSessionDateStorageKey=e.firstSessionDateStorageKey=e.currentSessionDateStorageKey=e.ICustomEndpointTelemetryService=e.ITelemetryService=void 0,e.ITelemetryService=(0,I.createDecorator)("telemetryService"),e.ICustomEndpointTelemetryService=(0,I.createDecorator)("customEndpointTelemetryService"),e.currentSessionDateStorageKey="telemetry.currentSessionDate",e.firstSessionDateStorageKey="telemetry.firstSessionDate",e.lastSessionDateStorageKey="telemetry.lastSessionDate",e.machineIdKey="telemetry.machineId",e.TELEMETRY_SECTION_ID="telemetry",e.TELEMETRY_SETTING_ID="telemetry.telemetryLevel",e.TELEMETRY_CRASH_REPORTER_SETTING_ID="telemetry.enableCrashReporter",e.TELEMETRY_OLD_SETTING_ID="telemetry.enableTelemetry";var O;(function(_){_[_.NONE=0]="NONE",_[_.CRASH=1]="CRASH",_[_.ERROR=2]="ERROR",_[_.USAGE=3]="USAGE"})(O||(e.TelemetryLevel=O={}));var A;(function(_){_.OFF="off",_.CRASH="crash",_.ERROR="error",_.ON="all"})(A||(e.TelemetryConfiguration=A={}))}),define(ce[220],le([0,1,36,5,34,26,16,6,11,131,31,146,97,13,23,21]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticsService=e.collectLaunchConfigs=e.getMachineInfo=e.collectWorkspaceStats=void 0;const l=new Map;async function d(t,o){const n=`${t}::${o.join(":")}`,s=l.get(n);if(s)return s;const i=[{tag:"grunt.js",filePattern:/^gruntfile\.js$/i},{tag:"gulp.js",filePattern:/^gulpfile\.js$/i},{tag:"tsconfig.json",filePattern:/^tsconfig\.json$/i},{tag:"package.json",filePattern:/^package\.json$/i},{tag:"jsconfig.json",filePattern:/^jsconfig\.json$/i},{tag:"tslint.json",filePattern:/^tslint\.json$/i},{tag:"eslint.json",filePattern:/^eslint\.json$/i},{tag:"tasks.json",filePattern:/^tasks\.json$/i},{tag:"launch.json",filePattern:/^launch\.json$/i},{tag:"settings.json",filePattern:/^settings\.json$/i},{tag:"webpack.config.js",filePattern:/^webpack\.config\.js$/i},{tag:"project.json",filePattern:/^project\.json$/i},{tag:"makefile",filePattern:/^makefile$/i},{tag:"sln",filePattern:/^.+\.sln$/i},{tag:"csproj",filePattern:/^.+\.csproj$/i},{tag:"cmake",filePattern:/^.+\.cmake$/i},{tag:"github-actions",filePattern:/^.+\.ya?ml$/i,relativePathPattern:/^\.github(?:\/|\\)workflows$/i},{tag:"devcontainer.json",filePattern:/^devcontainer\.json$/i},{tag:"dockerfile",filePattern:/^(dockerfile|docker\-compose\.ya?ml)$/i}],r=new Map,a=new Map,E=2e4;function v(C,U,F,M){const z=U.substring(C.length+1);return O.Promises.withAsyncBody(async V=>{let J;try{J=await P.Promises.readdir(U,{withFileTypes:!0})}catch{V();return}if(M.count>=E){M.count+=J.length,M.maxReached=!0,V();return}let H=J.length;if(H===0){V();return}let Y=J;M.count+J.length>E&&(M.maxReached=!0,H=E-M.count,Y=J.slice(0,H)),M.count+=J.length;for(const B of Y)if(B.isDirectory()){if(F.includes(B.name)||await v(C,(0,k.join)(U,B.name),F,M),--H===0){V();return}}else{const K=B.name.lastIndexOf(".");if(K>=0){const x=B.name.substring(K+1);x&&r.set(x,(r.get(x)??0)+1)}for(const x of i)x.relativePathPattern?.test(z)!==!1&&x.filePattern.test(B.name)&&a.set(x.tag,(a.get(x.tag)??0)+1);if(--H===0){V();return}}})}const u=O.Promises.withAsyncBody(async C=>{const U={count:0,maxReached:!1};await v(t,t,o,U);const F=await y(t);C({configFiles:c(a),fileTypes:c(r),fileCount:U.count,maxFilesReached:U.maxReached,launchConfigFiles:F})});return l.set(n,u),u}e.collectWorkspaceStats=d;function c(t){return Array.from(t.entries(),([o,n])=>({name:o,count:n})).sort((o,n)=>n.count-o.count)}function m(){const t={os:`${I.type()} ${I.arch()} ${I.release()}`,memory:`${(I.totalmem()/h.ByteSize.GB).toFixed(2)}GB (${(I.freemem()/h.ByteSize.GB).toFixed(2)}GB free)`,vmHint:`${Math.round(S.virtualMachineHint.value()*100)}%`},o=I.cpus();return o&&o.length>0&&(t.cpus=`${o[0].model} (${o.length} x ${o[0].speed})`),t}e.getMachineInfo=m;async function y(t){try{const o=new Map,n=(0,k.join)(t,".vscode","launch.json"),s=await P.Promises.readFile(n),i=[],r=(0,A.parse)(s.toString(),i);if(i.length)return console.log(`Unable to parse ${n}`),[];if((0,A.getNodeType)(r)==="object"&&r.configurations)for(const a of r.configurations){const E=a.type;E&&(o.has(E)?o.set(E,o.get(E)+1):o.set(E,1))}return c(o)}catch{return[]}}e.collectLaunchConfigs=y;let T=class{constructor(o,n){this.telemetryService=o,this.productService=n}formatMachineInfo(o){const n=[];return n.push(`OS Version:       ${o.os}`),n.push(`CPUs:             ${o.cpus}`),n.push(`Memory (System):  ${o.memory}`),n.push(`VM:               ${o.vmHint}`),n.join(`
`)}formatEnvironment(o){const n=[];n.push(`Version:          ${this.productService.nameShort} ${this.productService.version} (${this.productService.commit||"Commit unknown"}, ${this.productService.date||"Date unknown"})`),n.push(`OS Version:       ${I.type()} ${I.arch()} ${I.release()}`);const s=I.cpus();return s&&s.length>0&&n.push(`CPUs:             ${s[0].model} (${s.length} x ${s[0].speed})`),n.push(`Memory (System):  ${(I.totalmem()/h.ByteSize.GB).toFixed(2)}GB (${(I.freemem()/h.ByteSize.GB).toFixed(2)}GB free)`),D.isWindows||n.push(`Load (avg):       ${I.loadavg().map(i=>Math.round(i)).join(", ")}`),n.push(`VM:               ${Math.round(S.virtualMachineHint.value()*100)}%`),n.push(`Screen Reader:    ${o.screenReader?"yes":"no"}`),n.push(`Process Argv:     ${o.mainArguments.join(" ")}`),n.push(`GPU Status:       ${this.expandGPUFeatures(o.gpuFeatureStatus)}`),n.join(`
`)}async getPerformanceInfo(o,n){return Promise.all([(0,p.listProcesses)(o.mainPID),this.formatWorkspaceMetadata(o)]).then(async s=>{let[i,r]=s,a=this.formatProcessList(o,i);return n.forEach(E=>{if((0,g.isRemoteDiagnosticError)(E))a+=`
${E.errorMessage}`,r+=`
${E.errorMessage}`;else if(a+=`

Remote: ${E.hostName}`,E.processes&&(a+=`
${this.formatProcessList(o,E.processes)}`),E.workspaceMetadata){r+=`
|  Remote: ${E.hostName}`;for(const v of Object.keys(E.workspaceMetadata)){const u=E.workspaceMetadata[v];let C=`${u.fileCount} files`;u.maxFilesReached&&(C=`more than ${C}`),r+=`|    Folder (${v}): ${C}`,r+=this.formatWorkspaceStats(u)}}}),{processInfo:a,workspaceInfo:r}})}async getSystemInfo(o,n){const{memory:s,vmHint:i,os:r,cpus:a}=m(),E={os:r,memory:s,cpus:a,vmHint:i,processArgs:`${o.mainArguments.join(" ")}`,gpuStatus:o.gpuFeatureStatus,screenReader:`${o.screenReader?"yes":"no"}`,remoteData:n};return D.isWindows||(E.load=`${I.loadavg().map(v=>Math.round(v)).join(", ")}`),D.isLinux&&(E.linuxEnv={desktopSession:process.env.DESKTOP_SESSION,xdgSessionDesktop:process.env.XDG_SESSION_DESKTOP,xdgCurrentDesktop:process.env.XDG_CURRENT_DESKTOP,xdgSessionType:process.env.XDG_SESSION_TYPE}),Promise.resolve(E)}async getDiagnostics(o,n){const s=[];return(0,p.listProcesses)(o.mainPID).then(async i=>(s.push(""),s.push(this.formatEnvironment(o)),s.push(""),s.push(this.formatProcessList(o,i)),o.windows.some(r=>r.folderURIs&&r.folderURIs.length>0&&!r.remoteAuthority)&&(s.push(""),s.push("Workspace Stats: "),s.push(await this.formatWorkspaceMetadata(o))),n.forEach(r=>{if((0,g.isRemoteDiagnosticError)(r))s.push(`
${r.errorMessage}`);else if(s.push(`

`),s.push(`Remote:           ${r.hostName}`),s.push(this.formatMachineInfo(r.machineInfo)),r.processes&&s.push(this.formatProcessList(o,r.processes)),r.workspaceMetadata)for(const a of Object.keys(r.workspaceMetadata)){const E=r.workspaceMetadata[a];let v=`${E.fileCount} files`;E.maxFilesReached&&(v=`more than ${v}`),s.push(`Folder (${a}): ${v}`),s.push(this.formatWorkspaceStats(E))}}),s.push(""),s.push(""),s.join(`
`)))}formatWorkspaceStats(o){const n=[];let i=0;const r=(u,C)=>{const U=` ${u}(${C})`;i+U.length>60?(n.push(a),a="|                 ",i=a.length):i+=U.length,a+=U};let a="|      File types:";const E=10,v=o.fileTypes.length>E?E:o.fileTypes.length;for(let u=0;u<v;u++){const C=o.fileTypes[u];r(C.name,C.count)}if(n.push(a),o.configFiles.length>=0&&(a="|      Conf files:",i=0,o.configFiles.forEach(u=>{r(u.name,u.count)}),n.push(a)),o.launchConfigFiles.length>0){let u="|      Launch Configs:";o.launchConfigFiles.forEach(C=>{const U=C.count>1?` ${C.name}(${C.count})`:` ${C.name}`;u+=U}),n.push(u)}return n.join(`
`)}expandGPUFeatures(o){const n=Math.max(...Object.keys(o).map(s=>s.length));return Object.keys(o).map(s=>`${s}:  ${" ".repeat(n-s.length)}  ${o[s]}`).join(`
                  `)}formatWorkspaceMetadata(o){const n=[],s=[];return o.windows.forEach(i=>{i.folderURIs.length===0||i.remoteAuthority||(n.push(`|  Window (${i.title})`),i.folderURIs.forEach(r=>{const a=b.URI.revive(r);if(a.scheme===_.Schemas.file){const E=a.fsPath;s.push(d(E,["node_modules",".git"]).then(v=>{let u=`${v.fileCount} files`;v.maxFilesReached&&(u=`more than ${u}`),n.push(`|    Folder (${(0,k.basename)(E)}): ${u}`),n.push(this.formatWorkspaceStats(v))}).catch(v=>{n.push(`|      Error: Unable to collect workspace stats for folder ${E} (${v.toString()})`)}))}else n.push(`|    Folder (${a.toString()}): Workspace stats not available.`)}))}),Promise.all(s).then(i=>n.join(`
`)).catch(i=>`Unable to collect workspace stats: ${i}`)}formatProcessList(o,n){const s=new Map;o.windows.forEach(r=>s.set(r.pid,`window [${r.id}] (${r.title})`)),o.pidToNames.forEach(({pid:r,name:a})=>s.set(r,a));const i=[];return i.push("CPU %	Mem MB	   PID	Process"),n&&this.formatProcessItem(o.mainPID,s,i,n,0),i.join(`
`)}formatProcessItem(o,n,s,i,r){const a=r===0;let E;a?E=i.pid===o?`${this.productService.applicationName} main`:"remote agent":n.has(i.pid)?E=n.get(i.pid):E=`${"  ".repeat(r)} ${i.name}`;const v=process.platform==="win32"?i.mem:I.totalmem()*(i.mem/100);s.push(`${i.load.toFixed(0).padStart(5," ")}	${(v/h.ByteSize.MB).toFixed(0).padStart(6," ")}	${i.pid.toFixed(0).padStart(6," ")}	${E}`),Array.isArray(i.children)&&i.children.forEach(u=>this.formatProcessItem(o,n,s,u,r+1))}async getWorkspaceFileExtensions(o){const n=new Set;for(const{uri:s}of o.folders){const i=b.URI.revive(s);if(i.scheme!==_.Schemas.file)continue;const r=i.fsPath;try{(await d(r,["node_modules",".git"])).fileTypes.forEach(E=>n.add(E.name))}catch{}}return{extensions:[...n]}}async reportWorkspaceStats(o){for(const{uri:n}of o.folders){const s=b.URI.revive(n);if(s.scheme!==_.Schemas.file)continue;const i=s.fsPath;try{const r=await d(i,["node_modules",".git"]);this.telemetryService.publicLog2("workspace.stats",{"workspace.id":o.telemetryId,rendererSessionId:o.rendererSessionId}),r.fileTypes.forEach(a=>{this.telemetryService.publicLog2("workspace.stats.file",{rendererSessionId:o.rendererSessionId,type:a.name,count:a.count})}),r.launchConfigFiles.forEach(a=>{this.telemetryService.publicLog2("workspace.stats.launchConfigFile",{rendererSessionId:o.rendererSessionId,type:a.name,count:a.count})}),r.configFiles.forEach(a=>{this.telemetryService.publicLog2("workspace.stats.configFiles",{rendererSessionId:o.rendererSessionId,type:a.name,count:a.count})})}catch{}}}};e.DiagnosticsService=T,e.DiagnosticsService=T=Ee([G(0,w.ITelemetryService),G(1,f.IProductService)],T)}),define(ce[109],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryAppenderClient=e.TelemetryAppenderChannel=void 0;class I{constructor(_){this.appenders=_}listen(_,k){throw new Error(`Event not found: ${k}`)}call(_,k,{eventName:D,data:b}){return this.appenders.forEach(S=>S.log(D,b)),Promise.resolve(null)}}e.TelemetryAppenderChannel=I;class O{constructor(_){this.channel=_}log(_,k){return this.channel.call("log",{eventName:_,data:k}).then(void 0,D=>`Failed to log telemetry: ${console.warn(D)}`),Promise.resolve(null)}flush(){return Promise.resolve()}}e.TelemetryAppenderClient=O}),define(ce[46],le([0,1,30,12,3,18,74,108,21]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.cleanData=e.getPiiPathsFromEnvironment=e.isInternalTelemetry=e.cleanRemoteAuthority=e.validateTelemetryData=e.getTelemetryLevel=e.isLoggingOnly=e.supportsTelemetry=e.configurationTelemetry=e.NullAppender=e.extensionTelemetryLogChannelId=e.telemetryLogId=e.NullEndpointTelemetryService=e.NullTelemetryService=e.NullTelemetryServiceShape=e.TelemetryTrustedValue=void 0;class S{constructor(i){this.value=i,this.isTrustedTelemetryValue=!0}}e.TelemetryTrustedValue=S;class P{constructor(){this.telemetryLevel=0,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}}e.NullTelemetryServiceShape=P,e.NullTelemetryService=new P;class p{async publicLog(i,r,a){}async publicLogError(i,r,a){}}e.NullEndpointTelemetryService=p,e.telemetryLogId="telemetry",e.extensionTelemetryLogChannelId="extensionTelemetryLog",e.NullAppender={log:()=>null,flush:()=>Promise.resolve(null)};function g(s,i){return A.Event.debounce(i.onDidChangeConfiguration,(a,E)=>{const v=a?new Set([...a.affectedKeys,...E.affectedKeys]):E.affectedKeys;return{...E,affectedKeys:v}},1e3,!0)(a=>{a.source!==7&&s.publicLog2("updateConfiguration",{configurationSource:(0,_.ConfigurationTargetToString)(a.source),configurationKeys:Array.from(a.affectedKeys)})})}e.configurationTelemetry=g;function h(s,i){return!i.isBuilt&&!i.disableTelemetry?!0:!(i.disableTelemetry||!s.enableTelemetry||i.extensionTestsLocationURI)}e.supportsTelemetry=h;function f(s,i){return!(i.isBuilt||i.disableTelemetry||s.enableTelemetry&&s.aiConfig?.ariaKey)}e.isLoggingOnly=f;function w(s){const i=s.getValue(b.TELEMETRY_SETTING_ID),r=s.getValue(b.TELEMETRY_CRASH_REPORTER_SETTING_ID);if(s.getValue(b.TELEMETRY_OLD_SETTING_ID)===!1||r===!1)return 0;switch(i??"all"){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0}}e.getTelemetryLevel=w;function l(s){const i={},r={},a={};m(s,a);for(let E in a){E=E.length>150?E.substr(E.length-149):E;const v=a[E];typeof v=="number"?r[E]=v:typeof v=="boolean"?r[E]=v?1:0:typeof v=="string"?(v.length>8192&&console.warn(`Telemetry property: ${E} has been trimmed to 8192, the original length is ${v.length}`),i[E]=v.substring(0,8191)):typeof v<"u"&&v!==null&&(i[E]=v)}return{properties:i,measurements:r}}e.validateTelemetryData=l;const d=new Set(["ssh-remote","dev-container","attached-container","wsl","tunnel","codespaces","amlext"]);function c(s){if(!s)return"none";const i=(0,k.getRemoteName)(s);return d.has(i)?i:"other"}e.cleanRemoteAuthority=c;function m(s,i,r=0,a){if(s)for(const E of Object.getOwnPropertyNames(s)){const v=s[E],u=a?a+E:E;Array.isArray(v)?i[u]=(0,I.safeStringify)(v):v instanceof Date?i[u]=v.toISOString():(0,O.isObject)(v)?r<2?m(v,i,r+1,u+"."):i[u]=(0,I.safeStringify)(v):i[u]=v}}function y(s,i){const r=s.msftInternalDomains||[],a=i.getValue("telemetry.internalTesting");return(0,D.verifyMicrosoftInternalDomain)(r)||a}e.isInternalTelemetry=y;function T(s){return[s.appRoot,s.extensionsPath,s.userHome.fsPath,s.tmpDir.fsPath,s.userDataPath]}e.getPiiPathsFromEnvironment=T;function t(s,i){if(!s||!s.includes("/")&&!s.includes("\\"))return s;let r=s;const a=[];for(const C of i)for(;;){const U=C.exec(s);if(!U)break;a.push([U.index,C.lastIndex])}const E=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,v=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let u=0;for(r="";;){const C=v.exec(s);if(!C)break;const U=a.some(([F,M])=>C.index<M&&F<v.lastIndex);!E.test(C[0])&&!U&&(r+=s.substring(u,C.index)+"<REDACTED: user-file-path>",u=v.lastIndex)}return u<s.length&&(r+=s.substr(u)),r}function o(s){if(!s)return s;const i=[{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"Email",regex:/@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+/}];for(const r of i)if(r.regex.test(s))return`<REDACTED: ${r.label}>`;return s}function n(s,i){return(0,I.cloneAndChange)(s,r=>{if(r instanceof S||Object.hasOwnProperty.call(r,"isTrustedTelemetryValue"))return r.value;if(typeof r=="string"){let a=r.replaceAll("%20"," ");a=t(a,i);for(const E of i)a=a.replace(E,"");return a=o(a),a}})}e.cleanData=n}),define(ce[33],le([0,1,28,29,41,6,11,8,37,46]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.computeTargetPlatform=e.getExtensionDependencies=e.BetterMergeId=e.getGalleryExtensionTelemetryData=e.getLocalExtensionTelemetryData=e.groupByExtension=e.getGalleryExtensionId=e.adoptToGalleryExtensionId=e.getExtensionId=e.getIdAndVersion=e.ExtensionKey=e.areSameExtensions=void 0;function P(n,s){return n.uuid&&s.uuid?n.uuid===s.uuid:n.id===s.id?!0:(0,I.compareIgnoreCase)(n.id,s.id)===0}e.areSameExtensions=P;const p=/^([^.]+\..+)-(\d+\.\d+\.\d+)(-(.+))?$/;class g{static create(s){const i=s.manifest?s.manifest.version:s.version,r=s.manifest?s.targetPlatform:s.properties.targetPlatform;return new g(s.identifier,i,r)}static parse(s){const i=p.exec(s);return i&&i[1]&&i[2]?new g({id:i[1]},i[2],i[4]||void 0):null}constructor(s,i,r="undefined"){this.version=i,this.targetPlatform=r,this.id=s.id}toString(){return`${this.id}-${this.version}${this.targetPlatform!=="undefined"?`-${this.targetPlatform}`:""}`}equals(s){return s instanceof g?P(this,s)&&this.version===s.version&&this.targetPlatform===s.targetPlatform:!1}}e.ExtensionKey=g;const h=/^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/;function f(n){const s=h.exec(n);return s&&s[1]?[l(s[1]),s[2]]:[l(n),void 0]}e.getIdAndVersion=f;function w(n,s){return`${n}.${s}`}e.getExtensionId=w;function l(n){return n.toLowerCase()}e.adoptToGalleryExtensionId=l;function d(n,s){return l(w(n??A.UNDEFINED_PUBLISHER,s))}e.getGalleryExtensionId=d;function c(n,s){const i=[],r=a=>{for(const E of i)if(E.some(v=>P(s(v),s(a))))return E;return null};for(const a of n){const E=r(a);E?E.push(a):i.push([a])}return i}e.groupByExtension=c;function m(n){return{id:n.identifier.id,name:n.manifest.name,galleryId:null,publisherId:n.publisherId,publisherName:n.manifest.publisher,publisherDisplayName:n.publisherDisplayName,dependencies:n.manifest.extensionDependencies&&n.manifest.extensionDependencies.length>0,extensionVersion:n.manifest.version}}e.getLocalExtensionTelemetryData=m;function y(n){return{id:new S.TelemetryTrustedValue(n.identifier.id),name:new S.TelemetryTrustedValue(n.name),galleryId:n.identifier.uuid,publisherId:n.publisherId,publisherName:n.publisher,publisherDisplayName:n.publisherDisplayName,isPreReleaseVersion:n.properties.isPreReleaseVersion,dependencies:!!(n.properties.dependencies&&n.properties.dependencies.length>0),isSigned:n.isSigned,extensionVersion:n.version,...n.telemetryData}}e.getGalleryExtensionTelemetryData=y,e.BetterMergeId=new A.ExtensionIdentifier("pprice.better-merge");function T(n,s){const i=[],r=s.manifest.extensionDependencies?.slice(0)??[];for(;r.length;){const a=r.shift();if(a&&i.every(E=>!P(E.identifier,{id:a}))){const E=n.filter(v=>P(v.identifier,{id:a}));E.length===1&&(i.push(E[0]),r.push(...E[0].manifest.extensionDependencies?.slice(0)??[]))}}return i}e.getExtensionDependencies=T;async function t(n,s){if(!_.isLinux)return!1;let i;try{i=(await n.readFile(k.URI.file("/etc/os-release"))).value.toString()}catch{try{i=(await n.readFile(k.URI.file("/usr/lib/os-release"))).value.toString()}catch(a){s.debug("Error while getting the os-release file.",(0,D.getErrorMessage)(a))}}return!!i&&(i.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function o(n,s){const i=await t(n,s),r=(0,O.getTargetPlatform)(i?"alpine":_.platform,b.arch);return s.debug("ComputeTargetPlatform:",r),r}e.computeTargetPlatform=o}),define(ce[221],le([0,1,20,2,22,11,13,23,5,3,16,6,37,33]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractNativeExtensionTipsService=e.ExtensionTipsService=void 0;let f=class extends O.Disposable{constructor(m,y){super(),this.fileService=m,this.productService=y,this.allConfigBasedTips=new Map,this.productService.configBasedExtensionTips&&Object.entries(this.productService.configBasedExtensionTips).forEach(([,T])=>this.allConfigBasedTips.set(T.configPath,T))}getConfigBasedTips(m){return this.getValidConfigBasedTips(m)}async getImportantExecutableBasedTips(){return[]}async getOtherExecutableBasedTips(){return[]}async getValidConfigBasedTips(m){const y=[];for(const[T,t]of this.allConfigBasedTips)if(!(t.configScheme&&t.configScheme!==m.scheme))try{const o=(await this.fileService.readFile((0,A.joinPath)(m,T))).value.toString();for(const[n,s]of Object.entries(t.recommendations))(!s.contentPattern||new RegExp(s.contentPattern,"mig").test(o))&&y.push({extensionId:n,extensionName:s.name,configName:t.configName,important:!!s.important,isExtensionPack:!!s.isExtensionPack,whenNotInstalled:s.whenNotInstalled})}catch{}return y}};e.ExtensionTipsService=f,e.ExtensionTipsService=f=Ee([G(0,k.IFileService),G(1,D.IProductService)],f);const w="extensionTips/promptedExecutableTips",l="extensionTips/lastPromptedMediumImpExeTime";class d extends f{constructor(m,y,T,t,o,n,s,i){super(s,i),this.userHome=m,this.windowEvents=y,this.telemetryService=T,this.extensionManagementService=t,this.storageService=o,this.extensionRecommendationNotificationService=n,this.highImportanceExecutableTips=new Map,this.mediumImportanceExecutableTips=new Map,this.allOtherExecutableTips=new Map,this.highImportanceTipsByExe=new Map,this.mediumImportanceTipsByExe=new Map,i.exeBasedExtensionTips&&Object.entries(i.exeBasedExtensionTips).forEach(([r,a])=>{const E=[],v=[],u=[];Object.entries(a.recommendations).forEach(([C,U])=>{U.important?a.important?E.push({extensionId:C,extensionName:U.name,isExtensionPack:!!U.isExtensionPack}):v.push({extensionId:C,extensionName:U.name,isExtensionPack:!!U.isExtensionPack}):u.push({extensionId:C,extensionName:U.name,isExtensionPack:!!U.isExtensionPack})}),E.length&&this.highImportanceExecutableTips.set(r,{exeFriendlyName:a.friendlyName,windowsPath:a.windowsPath,recommendations:E}),v.length&&this.mediumImportanceExecutableTips.set(r,{exeFriendlyName:a.friendlyName,windowsPath:a.windowsPath,recommendations:v}),u.length&&this.allOtherExecutableTips.set(r,{exeFriendlyName:a.friendlyName,windowsPath:a.windowsPath,recommendations:u})}),(0,b.timeout)(3e3).then(async()=>{await this.collectTips(),this.promptHighImportanceExeBasedTip(),this.promptMediumImportanceExeBasedTip()})}async getImportantExecutableBasedTips(){const m=await this.getValidExecutableBasedExtensionTips(this.highImportanceExecutableTips),y=await this.getValidExecutableBasedExtensionTips(this.mediumImportanceExecutableTips);return[...m,...y]}getOtherExecutableBasedTips(){return this.getValidExecutableBasedExtensionTips(this.allOtherExecutableTips)}async collectTips(){const m=await this.getValidExecutableBasedExtensionTips(this.highImportanceExecutableTips),y=await this.getValidExecutableBasedExtensionTips(this.mediumImportanceExecutableTips),T=await this.extensionManagementService.getInstalled();this.highImportanceTipsByExe=this.groupImportantTipsByExe(m,T),this.mediumImportanceTipsByExe=this.groupImportantTipsByExe(y,T)}groupImportantTipsByExe(m,y){const T=new Map;m.forEach(i=>T.set(i.extensionId.toLowerCase(),i));const{installed:t,uninstalled:o}=this.groupByInstalled([...T.keys()],y);for(const i of t){const r=T.get(i);r&&this.telemetryService.publicLog2("exeExtensionRecommendations:alreadyInstalled",{extensionId:i,exeName:r.exeName})}for(const i of o){const r=T.get(i);r&&this.telemetryService.publicLog2("exeExtensionRecommendations:notInstalled",{extensionId:i,exeName:r.exeName})}const n=this.getPromptedExecutableTips(),s=new Map;for(const i of o){const r=T.get(i);if(r&&(!n[r.exeName]||!n[r.exeName].includes(r.extensionId))){let a=s.get(r.exeName);a||(a=[],s.set(r.exeName,a)),a.push(r)}}return s}promptHighImportanceExeBasedTip(){if(this.highImportanceTipsByExe.size===0)return;const[m,y]=[...this.highImportanceTipsByExe.entries()][0];this.promptExeRecommendations(y).then(T=>{switch(T){case"reacted":this.addToRecommendedExecutables(y[0].exeName,y);break;case"ignored":this.highImportanceTipsByExe.delete(m);break;case"incompatibleWindow":{const t=S.Event.once(S.Event.latch(S.Event.any(this.windowEvents.onDidOpenWindow,this.windowEvents.onDidFocusWindow)));this._register(t(()=>this.promptHighImportanceExeBasedTip()));break}case"toomany":{const t=this._register((0,b.disposableTimeout)(()=>{t.dispose(),this.promptHighImportanceExeBasedTip()},36e5));break}}})}promptMediumImportanceExeBasedTip(){if(this.mediumImportanceTipsByExe.size===0)return;const m=this.getLastPromptedMediumExeTime(),y=Date.now()-m,T=7*24*60*60*1e3;if(y<T){const n=this._register((0,b.disposableTimeout)(()=>{n.dispose(),this.promptMediumImportanceExeBasedTip()},T-y));return}const[t,o]=[...this.mediumImportanceTipsByExe.entries()][0];this.promptExeRecommendations(o).then(n=>{switch(n){case"reacted":{this.updateLastPromptedMediumExeTime(Date.now()),this.mediumImportanceTipsByExe.delete(t),this.addToRecommendedExecutables(o[0].exeName,o);const s=this._register((0,b.disposableTimeout)(()=>{s.dispose(),this.promptMediumImportanceExeBasedTip()},T));break}case"ignored":this.mediumImportanceTipsByExe.delete(t),this.promptMediumImportanceExeBasedTip();break;case"incompatibleWindow":{const s=S.Event.once(S.Event.latch(S.Event.any(this.windowEvents.onDidOpenWindow,this.windowEvents.onDidFocusWindow)));this._register(s(()=>this.promptMediumImportanceExeBasedTip()));break}case"toomany":{const s=this._register((0,b.disposableTimeout)(()=>{s.dispose(),this.promptMediumImportanceExeBasedTip()},36e5));break}}})}async promptExeRecommendations(m){const y=await this.extensionManagementService.getInstalled(1),T=m.filter(t=>!t.whenNotInstalled||t.whenNotInstalled.every(o=>y.every(n=>!(0,h.areSameExtensions)(n.identifier,{id:o})))).map(({extensionId:t})=>t.toLowerCase());return this.extensionRecommendationNotificationService.promptImportantExtensionsInstallNotification({extensions:T,source:3,name:m[0].exeFriendlyName,searchValue:`@exe:"${m[0].exeName}"`})}getLastPromptedMediumExeTime(){let m=this.storageService.getNumber(l,-1);return m||(m=Date.now(),this.updateLastPromptedMediumExeTime(m)),m}updateLastPromptedMediumExeTime(m){this.storageService.store(l,m,-1,1)}getPromptedExecutableTips(){return JSON.parse(this.storageService.get(w,-1,"{}"))}addToRecommendedExecutables(m,y){const T=this.getPromptedExecutableTips();T[m]=y.map(({extensionId:t})=>t.toLowerCase()),this.storageService.store(w,JSON.stringify(T),-1,0)}groupByInstalled(m,y){const T=[],t=[],o=y.reduce((n,s)=>(n.add(s.identifier.id.toLowerCase()),n),new Set);return m.forEach(n=>{o.has(n.toLowerCase())?T.push(n):t.push(n)}),{installed:T,uninstalled:t}}async getValidExecutableBasedExtensionTips(m){const y=[],T=new Map;for(const t of m.keys()){const o=m.get(t);if(!o||!(0,I.isNonEmptyArray)(o.recommendations))continue;const n=[];p.isWindows?o.windowsPath&&n.push(o.windowsPath.replace("%USERPROFILE%",()=>g.env.USERPROFILE).replace("%ProgramFiles(x86)%",()=>g.env["ProgramFiles(x86)"]).replace("%ProgramFiles%",()=>g.env.ProgramFiles).replace("%APPDATA%",()=>g.env.APPDATA).replace("%WINDIR%",()=>g.env.WINDIR)):(n.push((0,P.join)("/usr/local/bin",t)),n.push((0,P.join)("/usr/bin",t)),n.push((0,P.join)(this.userHome.fsPath,t)));for(const s of n){let i=T.get(s);if(i===void 0&&(i=await this.fileService.exists(_.URI.file(s)),T.set(s,i)),i)for(const{extensionId:r,extensionName:a,isExtensionPack:E,whenNotInstalled:v}of o.recommendations)y.push({extensionId:r,extensionName:a,isExtensionPack:E,exeName:t,exeFriendlyName:o.exeFriendlyName,windowsPath:o.windowsPath,whenNotInstalled:v})}}return y}}e.AbstractNativeExtensionTipsService=d}),define(ce[222],le([0,1,25,33]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.migrateUnsupportedExtensions=void 0;async function A(_,k,D,b,S){try{const P=await _.getExtensionsControlManifest();if(!P.deprecated)return;const p=await _.getInstalled(1);for(const[g,h]of Object.entries(P.deprecated)){if(!h?.extension)continue;const{id:f,autoMigrate:w,preRelease:l}=h.extension;if(!w)continue;const d=p.find(m=>(0,O.areSameExtensions)(m.identifier,{id:g}));if(!d)continue;const c=(await k.getExtensions([{id:f,preRelease:l}],{targetPlatform:await _.getTargetPlatform(),compatible:!0},I.CancellationToken.None))[0];if(!c){S.info(`Skipping migrating '${d.identifier.id}' extension because, the comaptible target '${f}' extension is not found`);continue}try{S.info(`Migrating '${d.identifier.id}' extension to '${f}' extension...`);const m=!b.getDisabledExtensions().some(T=>(0,O.areSameExtensions)(T,d.identifier));await _.uninstall(d),S.info(`Uninstalled the unsupported extension '${d.identifier.id}'`);let y=p.find(T=>(0,O.areSameExtensions)(T.identifier,{id:f}));(!y||!y.isPreReleaseVersion&&m)&&(y=await _.installFromGallery(c,{installPreReleaseVersion:!0,isMachineScoped:d.isMachineScoped,operation:4}),S.info(`Installed the pre-release extension '${y.identifier.id}'`),m||(await b.disableExtension(y.identifier),S.info(`Disabled the pre-release extension '${y.identifier.id}' because the unsupported extension '${d.identifier.id}' is disabled`)),w.storage&&(D.addToMigrationList((0,O.getExtensionId)(d.manifest.publisher,d.manifest.name),(0,O.getExtensionId)(y.manifest.publisher,y.manifest.name)),S.info("Added pre-release extension to the storage migration list"))),S.info(`Migrated '${d.identifier.id}' extension to '${f}' extension.`)}catch(m){S.error(m)}}}catch(P){S.error(P)}}e.migrateUnsupportedExtensions=A}),define(ce[223],le([0,1,3,2,35,33,41]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsWatcher=void 0;class D extends O.Disposable{constructor(S,P,p,g,h,f,w){super(),this.extensionManagementService=S,this.extensionsScannerService=P,this.userDataProfilesService=p,this.extensionsProfileScannerService=g,this.uriIdentityService=h,this.fileService=f,this.logService=w,this._onDidChangeExtensionsByAnotherSource=this._register(new I.Emitter),this.onDidChangeExtensionsByAnotherSource=this._onDidChangeExtensionsByAnotherSource.event,this.allExtensions=new Map,this.extensionsProfileWatchDisposables=this._register(new O.DisposableMap),this.initialize().then(null,l=>w.error(l))}async initialize(){await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.onDidChangeProfiles(this.userDataProfilesService.profiles),this.registerListeners(),await this.uninstallExtensionsNotInProfiles()}registerListeners(){this._register(this.userDataProfilesService.onDidChangeProfiles(S=>this.onDidChangeProfiles(S.added))),this._register(this.extensionsProfileScannerService.onAddExtensions(S=>this.onAddExtensions(S))),this._register(this.extensionsProfileScannerService.onDidAddExtensions(S=>this.onDidAddExtensions(S))),this._register(this.extensionsProfileScannerService.onRemoveExtensions(S=>this.onRemoveExtensions(S))),this._register(this.extensionsProfileScannerService.onDidRemoveExtensions(S=>this.onDidRemoveExtensions(S))),this._register(this.fileService.onDidFilesChange(S=>this.onDidFilesChange(S)))}async onDidChangeProfiles(S){try{S.length&&await Promise.all(S.map(P=>(this.extensionsProfileWatchDisposables.set(P.id,(0,O.combinedDisposable)(this.fileService.watch(this.uriIdentityService.extUri.dirname(P.extensionsResource)),this.fileService.watch(P.extensionsResource))),this.populateExtensionsFromProfile(P.extensionsResource))))}catch(P){throw this.logService.error(P),P}}async onAddExtensions(S){for(const P of S.extensions)this.addExtensionWithKey(this.getKey(P.identifier,P.version),S.profileLocation)}async onDidAddExtensions(S){for(const P of S.extensions){const p=this.getKey(P.identifier,P.version);S.error?this.removeExtensionWithKey(p,S.profileLocation):this.addExtensionWithKey(p,S.profileLocation)}}async onRemoveExtensions(S){for(const P of S.extensions)this.removeExtensionWithKey(this.getKey(P.identifier,P.version),S.profileLocation)}async onDidRemoveExtensions(S){const P=[],p=[];for(const g of S.extensions){const h=this.getKey(g.identifier,g.version);S.error?this.addExtensionWithKey(h,S.profileLocation):(this.removeExtensionWithKey(h,S.profileLocation),this.allExtensions.has(h)||(this.logService.debug("Extension is removed from all profiles",g.identifier.id,g.version),p.push(this.extensionManagementService.scanInstalledExtensionAtLocation(g.location).then(f=>{f?P.push(f):this.logService.info("Extension not found at the location",g.location.toString())},f=>this.logService.error(f)))))}try{await Promise.all(p),P.length&&await this.uninstallExtensionsNotInProfiles(P)}catch(g){this.logService.error(g)}}onDidFilesChange(S){for(const P of this.userDataProfilesService.profiles)S.contains(P.extensionsResource,0,1)&&this.onDidExtensionsProfileChange(P.extensionsResource)}async onDidExtensionsProfileChange(S){const P=[],p=[],g=await this.extensionsProfileScannerService.scanProfileExtensions(S),h=new Set,f=new Set;for(const[w,l]of this.allExtensions)l.has(S)&&f.add(w);for(const w of g){const l=this.getKey(w.identifier,w.version);h.add(l),f.has(l)||(P.push(w.identifier),this.addExtensionWithKey(l,S))}for(const w of f)if(!h.has(w)){const l=this.fromKey(w);l&&(p.push(l.identifier),this.removeExtensionWithKey(w,S))}(P.length||p.length)&&this._onDidChangeExtensionsByAnotherSource.fire({added:P.length?{extensions:P,profileLocation:S}:void 0,removed:p.length?{extensions:p,profileLocation:S}:void 0})}async populateExtensionsFromProfile(S){const P=await this.extensionsProfileScannerService.scanProfileExtensions(S);for(const p of P)this.addExtensionWithKey(this.getKey(p.identifier,p.version),S)}async uninstallExtensionsNotInProfiles(S){S||(S=(await this.extensionManagementService.scanAllUserInstalledExtensions()).filter(p=>!this.allExtensions.has(this.getKey(p.identifier,p.manifest.version)))),S.length&&await this.extensionManagementService.markAsUninstalled(...S)}addExtensionWithKey(S,P){let p=this.allExtensions.get(S);p||this.allExtensions.set(S,p=new A.ResourceSet(g=>this.uriIdentityService.extUri.getComparisonKey(g))),p.add(P)}removeExtensionWithKey(S,P){const p=this.allExtensions.get(S);p&&p.delete(P),p?.size||this.allExtensions.delete(S)}getKey(S,P){return`${k.ExtensionIdentifier.toKey(S.id)}@${P}`}fromKey(S){const[P,p]=(0,_.getIdAndVersion)(S);return p?{identifier:{id:P},version:p}:void 0}}e.ExtensionsWatcher=D}),define(ce[224],le([0,1,45,46]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveMarketplaceHeaders=void 0;async function A(_,k,D,b,S,P,p){const g={"X-Market-Client-Id":`VSCode ${_}`,"User-Agent":`VSCode ${_} (${k.nameShort})`};if((0,O.supportsTelemetry)(k,D)&&(0,O.getTelemetryLevel)(b)===3){const h=await(0,I.getServiceMachineId)(D,S,P);g["X-Market-User-Id"]=h,g["VSCode-SessionId"]=p.machineId||h}return g}e.resolveMarketplaceHeaders=A}),define(ce[225],le([0,1,68,20,5,2,26,16,31,15,29,33,7,71,11]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeLanguagePackService=void 0;let w=class extends h.LanguagePackBaseService{constructor(m,y,T,t){super(T),this.extensionManagementService=m,this.logService=t,this.cache=this._register(new l(y,t)),this.extensionManagementService.registerParticipant({postInstall:async o=>this.postInstallExtension(o),postUninstall:async o=>this.postUninstallExtension(o)})}async getBuiltInExtensionTranslationsUri(m,y){const t=(await this.cache.getLanguagePacks())[y];if(!t){this.logService.warn(`No language pack found for ${y}`);return}const o=t.translations[m];return o?f.URI.file(o):void 0}async getInstalledLanguages(){const m=await this.cache.getLanguagePacks(),y=Object.keys(m).map(T=>{const t=m[T];return{...this.createQuickPickItem(T,t.label),extensionId:t.extensions[0].extensionIdentifier.id}});return y.push(this.createQuickPickItem("en","English")),y.sort((T,t)=>T.label.localeCompare(t.label)),y}async postInstallExtension(m){m&&m.manifest&&m.manifest.contributes&&m.manifest.contributes.localizations&&m.manifest.contributes.localizations.length&&(this.logService.info("Adding language packs from the extension",m.identifier.id),await this.update())}async postUninstallExtension(m){const y=await this.cache.getLanguagePacks();Object.keys(y).some(T=>y[T]&&y[T].extensions.some(t=>(0,p.areSameExtensions)(t.extensionIdentifier,m.identifier)))&&(this.logService.info("Removing language packs from the extension",m.identifier.id),await this.update())}async update(){const[m,y]=await Promise.all([this.cache.getLanguagePacks(),this.extensionManagementService.getInstalled()]),T=await this.cache.update(y);return!(0,O.equals)(Object.keys(m),Object.keys(T))}};e.NativeLanguagePackService=w,e.NativeLanguagePackService=w=Ee([G(0,P.IExtensionManagementService),G(1,S.INativeEnvironmentService),G(2,P.IExtensionGalleryService),G(3,g.ILogService)],w);let l=class extends _.Disposable{constructor(m,y){super(),this.logService=y,this.languagePacks={},this.languagePacksFilePath=(0,D.join)(m.userDataPath,"languagepacks.json"),this.languagePacksFileLimiter=new A.Queue}getLanguagePacks(){return this.languagePacksFileLimiter.size||!this.initializedCache?this.withLanguagePacks().then(()=>this.languagePacks):Promise.resolve(this.languagePacks)}update(m){return this.withLanguagePacks(y=>{Object.keys(y).forEach(T=>delete y[T]),this.createLanguagePacksFromExtensions(y,...m)}).then(()=>this.languagePacks)}createLanguagePacksFromExtensions(m,...y){for(const T of y)T&&T.manifest&&T.manifest.contributes&&T.manifest.contributes.localizations&&T.manifest.contributes.localizations.length&&this.createLanguagePacksFromExtension(m,T);Object.keys(m).forEach(T=>this.updateHash(m[T]))}createLanguagePacksFromExtension(m,y){const T=y.identifier,t=y.manifest.contributes&&y.manifest.contributes.localizations?y.manifest.contributes.localizations:[];for(const o of t)if(y.location.scheme===k.Schemas.file&&d(o)){let n=m[o.languageId];n||(n={hash:"",extensions:[],translations:{},label:o.localizedLanguageName??o.languageName},m[o.languageId]=n);const s=n.extensions.filter(i=>(0,p.areSameExtensions)(i.extensionIdentifier,T))[0];s?s.version=y.manifest.version:n.extensions.push({extensionIdentifier:T,version:y.manifest.version});for(const i of o.translations)n.translations[i.id]=(0,D.join)(y.location.fsPath,i.path)}}updateHash(m){if(m){const y=(0,I.createHash)("md5");for(const T of m.extensions)y.update(T.extensionIdentifier.uuid||T.extensionIdentifier.id).update(T.version);m.hash=y.digest("hex")}}withLanguagePacks(m=()=>null){return this.languagePacksFileLimiter.queue(()=>{let y=null;return b.Promises.readFile(this.languagePacksFilePath,"utf8").then(void 0,T=>T.code==="ENOENT"?Promise.resolve("{}"):Promise.reject(T)).then(T=>{try{return JSON.parse(T)}catch{return{}}}).then(T=>(y=m(T),T)).then(T=>{for(const o of Object.keys(T))T[o]||delete T[o];this.languagePacks=T,this.initializedCache=!0;const t=JSON.stringify(this.languagePacks);return this.logService.debug("Writing language packs",t),b.Promises.writeFile(this.languagePacksFilePath,t)}).then(()=>y,T=>this.logService.error(T))})}};l=Ee([G(0,S.INativeEnvironmentService),G(1,g.ILogService)],l);function d(c){if(typeof c.languageId!="string"||!Array.isArray(c.translations)||c.translations.length===0)return!1;for(const m of c.translations)if(typeof m.id!="string"||typeof m.path!="string")return!1;return!(c.languageName&&typeof c.languageName!="string"||c.localizedLanguageName&&typeof c.localizedLanguageName!="string")}}),define(ce[226],le([0,1,143,8,30,46]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractOneDataSystemAppender=void 0;const k="https://mobile.events.data.microsoft.com/OneCollector/1.0",D="https://mobile.events.data.microsoft.com/ping";async function b(P,p,g){const h=await(0,I.importAMDNodeModule)("@microsoft/1ds-core-js","dist/ms.core.js"),f=await(0,I.importAMDNodeModule)("@microsoft/1ds-post-js","dist/ms.post.js"),w=new h.AppInsightsCore,l=new f.PostChannel,d={instrumentationKey:P,endpointUrl:k,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[l]]};if(g){d.extensionConfig={};const c={alwaysUseXhrOverride:!0,httpXHROverride:g};d.extensionConfig[l.identifier]=c}return w.initialize(d,[]),w.addTelemetryInitializer(c=>{p&&(c.ext=c.ext??{},c.ext.utc=c.ext.utc??{},c.ext.utc.flags=8462029)}),w}class S{constructor(p,g,h,f,w){this._isInternalTelemetry=p,this._eventPrefix=g,this._defaultData=h,this._xhrOverride=w,this.endPointUrl=k,this.endPointHealthUrl=D,this._defaultData||(this._defaultData={}),typeof f=="function"?this._aiCoreOrKey=f():this._aiCoreOrKey=f,this._asyncAiCore=null}_withAIClient(p){if(this._aiCoreOrKey){if(typeof this._aiCoreOrKey!="string"){p(this._aiCoreOrKey);return}this._asyncAiCore||(this._asyncAiCore=b(this._aiCoreOrKey,this._isInternalTelemetry,this._xhrOverride)),this._asyncAiCore.then(g=>{p(g)},g=>{(0,O.onUnexpectedError)(g),console.error(g)})}}log(p,g){if(!this._aiCoreOrKey)return;g=(0,A.mixin)(g,this._defaultData),g=(0,_.validateTelemetryData)(g);const h=this._eventPrefix+"/"+p;try{this._withAIClient(f=>{f.pluginVersionString=g?.properties.version??"Unknown",f.track({name:h,baseData:{name:h,properties:g?.properties,measurements:g?.measurements}})})}catch{}}flush(){return this._aiCoreOrKey?new Promise(p=>{this._withAIClient(g=>{g.unload(!0,()=>{this._aiCoreOrKey=void 0,p(void 0)})})}):Promise.resolve(void 0)}}e.AbstractOneDataSystemAppender=S}),define(ce[110],le([0,1,2,167,15,7,23,46]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryLogAppender=void 0;let b=class extends I.Disposable{constructor(P,p,g,h,f=""){super(),this.prefix=f;const w=p.getLogger(D.telemetryLogId);if(w)this.logger=this._register(w);else{const d=(0,D.isLoggingOnly)(h,g)?" (Not Sent)":"",c=()=>(0,D.supportsTelemetry)(h,g)&&P.getLevel()===_.LogLevel.Trace;this.logger=this._register(p.createLogger(D.telemetryLogId,{name:(0,O.localize)(0,null,d),hidden:!c()})),this._register(P.onDidChangeLogLevel(()=>p.setVisibility(D.telemetryLogId,c()))),this.logger.info("The below are logs for every telemetry event sent from VS Code once the log level is set to trace."),this.logger.info("===========================================================")}}flush(){return Promise.resolve(void 0)}log(P,p){this.logger.trace(`${this.prefix}telemetry/${P}`,(0,D.validateTelemetryData)(p))}};e.TelemetryLogAppender=b,e.TelemetryLogAppender=b=Ee([G(0,_.ILogService),G(1,_.ILoggerService),G(2,A.IEnvironmentService),G(3,k.IProductService)],b)}),define(ce[111],le([0,1,2,30,6,28,168,18,49,72,23,40,21,46]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TelemetryService=void 0;let f=class{static{this.IDLE_START_EVENT_NAME="UserIdleStart"}static{this.IDLE_STOP_EVENT_NAME="UserIdleStop"}constructor(d,c,m){this._configurationService=c,this._productService=m,this._experimentProperties={},this._disposables=new I.DisposableStore,this._cleanupPatterns=[],this._appenders=d.appenders,this._commonProperties=d.commonProperties??Object.create(null),this.sessionId=this._commonProperties.sessionID,this.machineId=this._commonProperties["common.machineId"],this.firstSessionDate=this._commonProperties["common.firstSessionDate"],this.msftInternal=this._commonProperties["common.msftInternal"],this._piiPaths=d.piiPaths||[],this._telemetryLevel=3,this._sendErrorTelemetry=!!d.sendErrorTelemetry,this._cleanupPatterns=[/(vscode-)?file:\/\/\/.*?\/resources\/app\//gi];for(const y of this._piiPaths)this._cleanupPatterns.push(new RegExp((0,_.escapeRegExpCharacters)(y),"gi")),y.indexOf("\\")>=0&&this._cleanupPatterns.push(new RegExp((0,_.escapeRegExpCharacters)(y.replace(/\\/g,"/")),"gi"));this._updateTelemetryLevel(),this._disposables.add(this._configurationService.onDidChangeConfiguration(y=>{(y.affectsConfiguration(g.TELEMETRY_SETTING_ID)||y.affectsConfiguration(g.TELEMETRY_OLD_SETTING_ID)||y.affectsConfiguration(g.TELEMETRY_CRASH_REPORTER_SETTING_ID))&&this._updateTelemetryLevel()}))}setExperimentProperty(d,c){this._experimentProperties[d]=c}_updateTelemetryLevel(){let d=(0,h.getTelemetryLevel)(this._configurationService);const c=this._productService.enabledTelemetryLevels;if(c){this._sendErrorTelemetry=this.sendErrorTelemetry?c.error:!1;const m=c.usage?3:c.error?2:0;d=Math.min(d,m)}this._telemetryLevel=d}get sendErrorTelemetry(){return this._sendErrorTelemetry}get telemetryLevel(){return this._telemetryLevel}dispose(){this._disposables.dispose()}_log(d,c,m){this._telemetryLevel<c||(m=(0,O.mixin)(m,this._experimentProperties),m=(0,h.cleanData)(m,this._cleanupPatterns),m=(0,O.mixin)(m,this._commonProperties),this._appenders.forEach(y=>y.log(d,m)))}publicLog(d,c){this._log(d,3,c)}publicLog2(d,c){this.publicLog(d,c)}publicLogError(d,c){this._sendErrorTelemetry&&this._log(d,2,c)}publicLogError2(d,c){this.publicLogError(d,c)}};e.TelemetryService=f,e.TelemetryService=f=Ee([G(1,D.IConfigurationService),G(2,P.IProductService)],f);function w(){const l=(0,k.localize)(0,null,S.default.nameLong),d=S.default.privacyStatementUrl?(0,k.localize)(2,null,"https://aka.ms/vscode-telemetry",S.default.privacyStatementUrl):(0,k.localize)(1,null,"https://aka.ms/vscode-telemetry"),c=A.isWeb?"":(0,k.localize)(3,null),m=(0,k.localize)(4,null),y=(0,k.localize)(5,null),T=(0,k.localize)(6,null),t=(0,k.localize)(7,null),o=`
|       | ${m} | ${y} | ${T} |
|:------|:---------------------:|:---------------:|:--------------:|
| all   |            \u2713          |        \u2713        |        \u2713       |
| error |            \u2713          |        \u2713        |        -       |
| crash |            \u2713          |        -        |        -       |
| off   |            -          |        -        |        -       |
`,n=(0,k.localize)(8,null);return`
${l} ${d} ${c}

&nbsp;

${t}
${o}

&nbsp;

${n}
`}p.Registry.as(b.Extensions.Configuration).registerConfiguration({id:g.TELEMETRY_SECTION_ID,order:1,type:"object",title:(0,k.localize)(9,null),properties:{[g.TELEMETRY_SETTING_ID]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[(0,k.localize)(10,null),(0,k.localize)(11,null),(0,k.localize)(12,null),(0,k.localize)(13,null)],markdownDescription:w(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"]}}}),p.Registry.as(b.Extensions.Configuration).registerConfiguration({id:g.TELEMETRY_SECTION_ID,order:110,type:"object",title:(0,k.localize)(14,null),properties:{[g.TELEMETRY_OLD_SETTING_ID]:{type:"boolean",markdownDescription:S.default.privacyStatementUrl?(0,k.localize)(16,null,S.default.nameLong,S.default.privacyStatementUrl):(0,k.localize)(15,null,S.default.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:(0,k.localize)(17,null,`\`#${g.TELEMETRY_SETTING_ID}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}})}),define(ce[227],le([0,1,14,25,272,226]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OneDataSystemAppender=void 0;async function k(P,p){const g=await p.request(P,O.CancellationToken.None),h=(await(0,I.streamToBuffer)(g.stream)).toString(),f=g.res.statusCode??200;return{headers:g.res.headers,statusCode:f,responseData:h}}async function D(P){const p={method:P.type,headers:P.headers};return new Promise((h,f)=>{const w=A.request(P.url??"",p,l=>{l.on("data",function(d){h({headers:l.headers,statusCode:l.statusCode??200,responseData:d.toString()})}),l.on("error",function(d){f(d)})});w.write(P.data,l=>{l&&f(l)}),w.end()})}async function b(P,p,g){const h=typeof p.data=="string"?p.data:new TextDecoder().decode(p.data),f={type:"POST",headers:{...p.headers,"Content-Type":"application/json","Content-Length":Buffer.byteLength(p.data).toString()},url:p.urlString,data:h};try{const w=P?await k(f,P):await D(f);g(w.statusCode,w.headers,w.responseData)}catch{g(0,{})}}class S extends _.AbstractOneDataSystemAppender{constructor(p,g,h,f,w){const l={sendPOST:(d,c)=>{b(p,d,c)}};super(g,h,f,w,l)}}e.OneDataSystemAppender=S}),define(ce[228],le([0,1,26,95,18,15,7,23,21,109,110,111]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CustomEndpointTelemetryService=void 0;let g=class{constructor(f,w,l,d,c,m){this.configurationService=f,this.telemetryService=w,this.logService=l,this.loggerService=d,this.environmentService=c,this.productService=m,this.customTelemetryServices=new Map}getCustomTelemetryService(f){if(!this.customTelemetryServices.has(f.id)){const w=Object.create(null);w["common.vscodemachineid"]=this.telemetryService.machineId,w["common.vscodesessionid"]=this.telemetryService.sessionId;const l=[f.id,JSON.stringify(w),f.aiKey],c=new O.Client(I.FileAccess.asFileUri("bootstrap-fork").fsPath,{serverName:"Debug Telemetry",timeout:1e3*60*5,args:l,env:{ELECTRON_RUN_AS_NODE:1,VSCODE_PIPE_LOGGING:"true",VSCODE_AMD_ENTRYPOINT:"vs/workbench/contrib/debug/node/telemetryApp"}}).getChannel("telemetryAppender"),m=[new S.TelemetryAppenderClient(c),new P.TelemetryLogAppender(this.logService,this.loggerService,this.environmentService,this.productService,`[${f.id}] `)];this.customTelemetryServices.set(f.id,new p.TelemetryService({appenders:m,sendErrorTelemetry:f.sendErrorTelemetry},this.configurationService,this.productService))}return this.customTelemetryServices.get(f.id)}publicLog(f,w,l){this.getCustomTelemetryService(f).publicLog(w,l)}publicLogError(f,w,l){this.getCustomTelemetryService(f).publicLogError(w,l)}};e.CustomEndpointTelemetryService=g,e.CustomEndpointTelemetryService=g=Ee([G(0,A.IConfigurationService),G(1,b.ITelemetryService),G(2,k.ILogService),G(3,k.ILoggerService),G(4,_.IEnvironmentService),G(5,D.IProductService)],g)}),define(ce[76],le([0,1,3,18,4,7]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractTunnelService=e.DisposableTunnel=e.isPortPrivileged=e.isAllInterfaces=e.ALL_INTERFACES_ADDRESSES=e.isLocalhost=e.LOCALHOST_ADDRESSES=e.extractLocalHostUriMetaDataForPortMapping=e.ProvidedOnAutoForward=e.isTunnelProvider=e.TunnelPrivacyId=e.TunnelProtocol=e.ISharedTunnelsService=e.ITunnelService=void 0,e.ITunnelService=(0,A.createDecorator)("tunnelService"),e.ISharedTunnelsService=(0,A.createDecorator)("sharedTunnelsService");var k;(function(l){l.Http="http",l.Https="https"})(k||(e.TunnelProtocol=k={}));var D;(function(l){l.ConstantPrivate="constantPrivate",l.Private="private",l.Public="public"})(D||(e.TunnelPrivacyId=D={}));function b(l){return!!l.forwardPort}e.isTunnelProvider=b;var S;(function(l){l[l.Notify=1]="Notify",l[l.OpenBrowser=2]="OpenBrowser",l[l.OpenPreview=3]="OpenPreview",l[l.Silent=4]="Silent",l[l.Ignore=5]="Ignore",l[l.OpenBrowserOnce=6]="OpenBrowserOnce"})(S||(e.ProvidedOnAutoForward=S={}));function P(l){if(l.scheme!=="http"&&l.scheme!=="https")return;const d=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(l.authority);if(d)return{address:d[1],port:+d[2]}}e.extractLocalHostUriMetaDataForPortMapping=P,e.LOCALHOST_ADDRESSES=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function p(l){return e.LOCALHOST_ADDRESSES.indexOf(l)>=0}e.isLocalhost=p,e.ALL_INTERFACES_ADDRESSES=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function g(l){return e.ALL_INTERFACES_ADDRESSES.indexOf(l)>=0}e.isAllInterfaces=g;function h(l,d,c,m){if(c===1)return!1;if(c===2&&g(d)){const y=/(\d+)\.(\d+)\.(\d+)/g.exec(m);if(y?.length===4&&parseInt(y[1])>=18)return!1}return l<1024}e.isPortPrivileged=h;class f{constructor(d,c,m){this.remoteAddress=d,this.localAddress=c,this._dispose=m,this._onDispose=new I.Emitter,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}e.DisposableTunnel=f;let w=class{constructor(d,c){this.logService=d,this.configurationService=c,this._onTunnelOpened=new I.Emitter,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new I.Emitter,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new I.Emitter,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const d=this.configurationService.getValue("remote.localPortHost");return!d||d==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(d){return this._tunnelProvider=d,d?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(d){this._canElevate=d.elevation,this._privacyOptions=d.privacyOptions}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const d=[],c=Array.from(this._tunnels.values());for(const m of c){const y=Array.from(m.values());for(const T of y){const t=await T.value;t&&typeof t!="string"&&d.push(t)}}return d}async dispose(){for(const d of this._tunnels.values()){for(const{value:c}of d.values())await c.then(m=>typeof m!="string"?m?.dispose():void 0);d.clear()}this._tunnels.clear()}setEnvironmentTunnel(d,c,m,y,T){this.addTunnelToMap(d,c,Promise.resolve({tunnelRemoteHost:d,tunnelRemotePort:c,localAddress:m,privacy:y,protocol:T,dispose:()=>Promise.resolve()}))}async getExistingTunnel(d,c){(g(d)||p(d))&&(d=e.LOCALHOST_ADDRESSES[0]);const m=this.getTunnelFromMap(d,c);if(m)return++m.refcount,m.value}openTunnel(d,c,m,y,T,t=!1,o,n){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${c}:${m} on local port ${T}.`);const s=this._tunnelProvider??d;if(!s)return;if(c||(c="localhost"),y||(y=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(m)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const i=this.retainOrCreateTunnel(s,c,m,y,T,t,o,n);return i?i.then(r=>{if(r){if(typeof r=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(c,m),r}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(c,m);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const a=this.makeTunnel(r);return(r.tunnelRemoteHost!==c||r.tunnelRemotePort!==m)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),o&&r.privacy!==o&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(a),a}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),i)}makeTunnel(d){return{tunnelRemotePort:d.tunnelRemotePort,tunnelRemoteHost:d.tunnelRemoteHost,tunnelLocalPort:d.tunnelLocalPort,localAddress:d.localAddress,privacy:d.privacy,protocol:d.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${d.tunnelRemoteHost}:${d.tunnelRemotePort} `);const c=this._tunnels.get(d.tunnelRemoteHost);if(c){const m=c.get(d.tunnelRemotePort);m&&(m.refcount--,await this.tryDisposeTunnel(d.tunnelRemoteHost,d.tunnelRemotePort,m))}}}}async tryDisposeTunnel(d,c,m){if(m.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${d}:${c}.`);const y=m.value.then(async T=>{T&&typeof T!="string"&&(await T.dispose(!0),this._onTunnelClosed.fire({host:T.tunnelRemoteHost,port:T.tunnelRemotePort}))});return this._tunnels.has(d)&&this._tunnels.get(d).delete(c),y}}async closeTunnel(d,c){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${d}:${c} `);const m=this._tunnels.get(d);if(m&&m.has(c)){const y=m.get(c);y.refcount=0,await this.tryDisposeTunnel(d,c,y)}}addTunnelToMap(d,c,m){this._tunnels.has(d)||this._tunnels.set(d,new Map),this._tunnels.get(d).set(c,{refcount:1,value:m})}async removeEmptyOrErrorTunnelFromMap(d,c){const m=this._tunnels.get(d);if(m){const y=m.get(c),T=y?await y.value:void 0;(!T||typeof T=="string")&&m.delete(c),m.size===0&&this._tunnels.delete(d)}}getTunnelFromMap(d,c){const m=[d];p(d)?(m.push(...e.LOCALHOST_ADDRESSES),m.push(...e.ALL_INTERFACES_ADDRESSES)):g(d)&&m.push(...e.ALL_INTERFACES_ADDRESSES);const y=m.map(T=>this._tunnels.get(T));for(const T of y){const t=T?.get(c);if(t)return t}}canTunnel(d){return!!P(d)}createWithProvider(d,c,m,y,T,t,o){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${c}:${m} on local port ${y}.`);const n=m;this._factoryInProgress.add(n);const s=y===void 0?m:y,i={elevationRequired:T?this.isPortPrivileged(s):!1},r={remoteAddress:{host:c,port:m},localAddressPort:y,privacy:t,public:t?t!==D.Private:void 0,protocol:o},a=d.forwardPort(r,i);return a?(this.addTunnelToMap(c,m,a),a.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(n)})):this._factoryInProgress.delete(n),a}};e.AbstractTunnelService=w,e.AbstractTunnelService=w=Ee([G(0,_.ILogService),G(1,O.IConfigurationService)],w)}),define(ce[229],le([0,1,7,76,2,8,5]),function(te,e,I,O,A,_,k){"use strict";var D;Object.defineProperty(e,"__esModule",{value:!0}),e.SharedProcessTunnelService=void 0;class b extends A.Disposable{constructor(){super(),this._address=null,this._addressPromise=null}async getAddress(){return this._address?this._address:(this._addressPromise||(this._addressPromise=new k.DeferredPromise),this._addressPromise.p)}setAddress(p){this._address=p,this._addressPromise&&(this._addressPromise.complete(p),this._addressPromise=null)}setTunnel(p){this._register(p)}}let S=class extends A.Disposable{static{D=this}static{this._lastId=0}constructor(p,g){super(),this._tunnelService=p,this._logService=g,this._tunnels=new Map,this._disposedTunnels=new Set}dispose(){super.dispose(),this._tunnels.forEach(p=>p.dispose())}async createTunnel(){return{id:String(++D._lastId)}}async startTunnel(p,g,h,f,w,l,d){const c=new b,m=await Promise.resolve(this._tunnelService.openTunnel(p,c,h,f,w,l,d));if(!m||typeof m=="string")throw this._logService.info(`[SharedProcessTunnelService] Could not create a tunnel to ${h}:${f} (remote).`),c.dispose(),new Error("Could not create tunnel");if(this._disposedTunnels.has(g))throw this._disposedTunnels.delete(g),c.dispose(),await m.dispose(),(0,_.canceled)();return c.setTunnel(m),this._tunnels.set(g,c),this._logService.info(`[SharedProcessTunnelService] Created tunnel ${g}: ${m.localAddress} (local) to ${h}:${f} (remote).`),{tunnelLocalPort:m.tunnelLocalPort,localAddress:m.localAddress}}async setAddress(p,g){const h=this._tunnels.get(p);h&&h.setAddress(g)}async destroyTunnel(p){const g=this._tunnels.get(p);if(g){this._logService.info(`[SharedProcessTunnelService] Disposing tunnel ${p}.`),this._tunnels.delete(p),await g.dispose();return}this._disposedTunnels.add(p)}};e.SharedProcessTunnelService=S,e.SharedProcessTunnelService=S=D=Ee([G(0,O.ISharedTunnelsService),G(1,I.ILogService)],S)}),define(ce[27],le([0,1,4]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IUriIdentityService=void 0,e.IUriIdentityService=(0,I.createDecorator)("IUriIdentityService")}),define(ce[230],le([0,1,27,185,13,22,127,3,2]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UriIdentityService=void 0;class S{static{this._clock=0}constructor(g){this.uri=g,this.time=S._clock++}touch(){return this.time=S._clock++,this}}let P=class{constructor(g){this._fileService=g,this._dispooables=new b.DisposableStore,this._limit=2**16;const h=new Map,f=w=>{let l=h.get(w.scheme);return l===void 0&&(l=g.hasProvider(w)&&!this._fileService.hasCapability(w,1024),h.set(w.scheme,l)),l};this._dispooables.add(D.Event.any(g.onDidChangeFileSystemProviderRegistrations,g.onDidChangeFileSystemProviderCapabilities)(w=>{h.delete(w.scheme)})),this.extUri=new _.ExtUri(f),this._canonicalUris=new k.SkipList((w,l)=>this.extUri.compare(w,l,!0),this._limit)}dispose(){this._dispooables.dispose(),this._canonicalUris.clear()}asCanonicalUri(g){this._fileService.hasProvider(g)&&(g=(0,_.normalizePath)(g));const h=this._canonicalUris.get(g);return h?h.touch().uri.with({fragment:g.fragment}):(this._canonicalUris.set(g,new S(g)),this._checkTrim(),g)}_checkTrim(){if(this._canonicalUris.size<this._limit)return;const g=[...this._canonicalUris.entries()].sort((f,w)=>f[1].time<w[1].time?1:f[1].time>w[1].time?-1:0);S._clock=0,this._canonicalUris.clear();const h=this._limit*.5;for(let f=0;f<h;f++)this._canonicalUris.set(g[f][0],g[f][1].touch())}};e.UriIdentityService=P,e.UriIdentityService=P=Ee([G(0,A.IFileService)],P),(0,O.registerSingleton)(I.IUriIdentityService,P,1)}),define(ce[231],le([0,1,3,2,13,43,47,14]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileUserDataProvider=void 0;class b extends O.Disposable{get capabilities(){return this.fileSystemProvider.capabilities&-5}constructor(P,p,g,h){super(),this.fileSystemScheme=P,this.fileSystemProvider=p,this.userDataScheme=g,this.logService=h,this.onDidChangeCapabilities=this.fileSystemProvider.onDidChangeCapabilities,this._onDidChangeFile=this._register(new I.Emitter),this.onDidChangeFile=this._onDidChangeFile.event,this.watchResources=k.TernarySearchTree.forUris(()=>!(this.capabilities&1024)),this._register(this.fileSystemProvider.onDidChangeFile(f=>this.handleFileChanges(f)))}watch(P,p){this.watchResources.set(P,P);const g=this.fileSystemProvider.watch(this.toFileSystemResource(P),p);return(0,O.toDisposable)(()=>{this.watchResources.delete(P),g.dispose()})}stat(P){return this.fileSystemProvider.stat(this.toFileSystemResource(P))}mkdir(P){return this.fileSystemProvider.mkdir(this.toFileSystemResource(P))}rename(P,p,g){return this.fileSystemProvider.rename(this.toFileSystemResource(P),this.toFileSystemResource(p),g)}readFile(P){return this.fileSystemProvider.readFile(this.toFileSystemResource(P),{atomic:!0})}readFileStream(P,p,g){const h=(0,_.newWriteableStream)(f=>D.VSBuffer.concat(f.map(w=>D.VSBuffer.wrap(w))).buffer);return(async()=>{try{const f=await this.readFile(P);h.end(f)}catch(f){h.error(f),h.end()}})(),h}readdir(P){return this.fileSystemProvider.readdir(this.toFileSystemResource(P))}writeFile(P,p,g){return this.fileSystemProvider.writeFile(this.toFileSystemResource(P),p,g)}delete(P,p){return this.fileSystemProvider.delete(this.toFileSystemResource(P),p)}copy(P,p,g){if((0,A.hasFileFolderCopyCapability)(this.fileSystemProvider))return this.fileSystemProvider.copy(this.toFileSystemResource(P),this.toFileSystemResource(p),g);throw new Error("copy not supported")}handleFileChanges(P){const p=[];for(const g of P){if(g.resource.scheme!==this.fileSystemScheme)continue;const h=this.toUserDataResource(g.resource);this.watchResources.findSubstr(h)&&p.push({resource:h,type:g.type})}p.length&&(this.logService.debug("User data changed"),this._onDidChangeFile.fire(p))}toFileSystemResource(P){return P.with({scheme:this.fileSystemScheme})}toUserDataResource(P){return P.with({scheme:this.userDataScheme})}}e.FileUserDataProvider=b}),define(ce[77],le([0,1,85]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLineEndOffset=e.getLineStartOffset=e.edit=void 0;function O(k,D,b,S){const P=(0,I.setProperty)(k,D,b,S)[0];return P&&(k=k.substring(0,P.offset)+P.content+k.substring(P.offset+P.length)),k}e.edit=O;function A(k,D,b){let S=b;for(;S>=0;){if(k.charAt(S)===D.charAt(D.length-1)&&D.length===1)return S+1;if(S--,D.length===2&&S>=0&&k.charAt(S)===D.charAt(0))return S+2}return 0}e.getLineStartOffset=A;function _(k,D,b){let S=b;for(;S>=0;)if(k.charAt(S)===D.charAt(D.length-1)&&D.length===1||(S++,D.length===2&&S>=0&&k.charAt(S)===D.charAt(1)))return S;return k.length-1}e.getLineEndOffset=_}),define(ce[232],le([0,1,30,53,12]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;function _(h,f,w,l,d,c){const m=[],y=[],T=[];if(!f){const V=h.filter(({identifier:J})=>d.every(H=>H.toLowerCase()!==J.id.toLowerCase()));return{local:{added:m,removed:y,updated:T},remote:V.length>0?{added:V,updated:[],removed:[],all:V}:null}}h=h.map(p),f=f.map(p),w=w?w.map(p):null;const t=new Map,o=V=>{V.uuid&&t.set(V.id.toLowerCase(),V.uuid)};h.forEach(({identifier:V})=>o(V)),f.forEach(({identifier:V})=>o(V)),w?.forEach(({identifier:V})=>o(V));const n=V=>{const J=V.identifier.uuid||t.get(V.identifier.id.toLowerCase());return J?`uuid:${J}`:`id:${V.identifier.id.toLowerCase()}`},s=(V,J)=>(V.set(n(J),J),V),i=h.reduce(s,new Map),r=f.reduce(s,new Map),a=f.reduce((V,J)=>s(V,(0,I.deepClone)(J)),new Map),E=w?w.reduce(s,new Map):null,v=l.reduce(s,new Map),u=d.reduce((V,J)=>{const H=t.get(J.toLowerCase());return V.add(H?`uuid:${H}`:`id:${J.toLowerCase()}`)},new Set),C=c?c.reduce((V,{id:J,uuid:H})=>(H=H??t.get(J.toLowerCase()),V.add(H?`uuid:${H}`:`id:${J.toLowerCase()}`)),new Set):null,U=k(i,r,u,!1);if(U.added.size>0||U.removed.size>0||U.updated.size>0){const V=k(E,i,u,!1),J=k(E,r,u,!0),H=(Y,B,K,x)=>{let q,j,Z;return B.installed?(q=x.pinned,Z=x.preRelease,q&&(j=x.version)):(q=K.pinned,Z=K.preRelease,q&&(j=K.version)),q===void 0&&(q=B.pinned,q&&(j=B.version)),Z===void 0&&(Z=B.preRelease),{...x,installed:B.installed||K.installed,pinned:q,preRelease:Z,version:j??(K.version&&(!B.installed||O.gt(K.version,B.version))?K.version:B.version),state:b(B,K,E?.get(Y))}};for(const Y of J.removed.values()){const B=i.get(Y);if(!B)continue;const K=(0,A.assertIsDefined)(E?.get(Y)),x=C&&!C.has(Y)&&K.installed;B.installed&&x?y.push(B.identifier):a.set(Y,B)}for(const Y of J.added.values()){const B=(0,A.assertIsDefined)(r.get(Y)),K=i.get(Y);if(K){if(U.updated.has(Y)){const x=H(Y,K,B,B);D(K,B,!1,!1)||T.push(g(x,Y)),a.set(Y,x)}}else B.installed&&m.push(g(B,Y))}for(const Y of J.updated.values()){const B=(0,A.assertIsDefined)(r.get(Y)),K=(0,A.assertIsDefined)(E?.get(Y)),x=i.get(Y);if(x)if(C&&!C.has(Y)&&K.installed&&x.installed&&!B.installed)y.push(x.identifier);else{const j=H(Y,x,B,B);T.push(g(j,Y)),a.set(Y,j)}else B.installed&&m.push(g(B,Y))}for(const Y of V.added.values())J.added.has(Y)||a.set(Y,(0,A.assertIsDefined)(i.get(Y)));for(const Y of V.updated.values()){if(J.removed.has(Y)||J.updated.has(Y))continue;const B=(0,A.assertIsDefined)(i.get(Y)),K=(0,A.assertIsDefined)(r.get(Y));a.set(Y,H(Y,B,K,B))}for(const Y of V.removed.values())J.updated.has(Y)||J.removed.has(Y)||v.has(Y)||(0,A.assertIsDefined)(r.get(Y)).installed&&C&&(C.has(Y)||!(0,A.assertIsDefined)(E?.get(Y)).installed||a.delete(Y))}const F=[],M=k(r,a,new Set,!0),z=M.added.size>0||M.updated.size>0||M.removed.size>0;return z&&a.forEach((V,J)=>F.push(g(V,J))),{local:{added:m,removed:y,updated:T},remote:z?{added:[...M.added].map(V=>a.get(V)),updated:[...M.updated].map(V=>a.get(V)),removed:[...M.removed].map(V=>r.get(V)),all:F}:null}}e.merge=_;function k(h,f,w,l){const d=h?[...h.keys()].filter(t=>!w.has(t)):[],c=[...f.keys()].filter(t=>!w.has(t)),m=c.filter(t=>!d.includes(t)).reduce((t,o)=>(t.add(o),t),new Set),y=d.filter(t=>!c.includes(t)).reduce((t,o)=>(t.add(o),t),new Set),T=new Set;for(const t of d){if(y.has(t))continue;const o=h.get(t),n=f.get(t);(!n||!D(o,n,l,!0))&&T.add(t)}return{added:m,removed:y,updated:T}}function D(h,f,w,l){return!(h.disabled!==f.disabled||!!h.isApplicationScoped!=!!f.isApplicationScoped||l&&h.installed!==f.installed||h.installed&&f.installed&&(h.preRelease!==f.preRelease||h.pinned!==f.pinned||f.pinned&&h.version!==f.version)||!P(h.state,f.state)||w&&h.version!==f.version)}function b(h,f,w){const l=h.state,d=f.state,c=w?.state;if(!f.version||l&&O.gt(h.version,f.version))return l;if(d&&O.gt(f.version,h.version)||!l)return d;if(!d)return l;const m=(0,I.deepClone)(l),y=c?S(c,d):{added:Object.keys(d).reduce((t,o)=>(t.add(o),t),new Set),removed:new Set,updated:new Set},T=c?S(c,l):{added:Object.keys(l).reduce((t,o)=>(t.add(o),t),new Set),removed:new Set,updated:new Set};for(const t of[...y.added.values(),...y.updated.values()])m[t]=d[t];for(const t of y.removed.values())T.updated.has(t)||delete m[t];return m}function S(h,f){const w=Object.keys(h),l=Object.keys(f),d=l.filter(y=>!w.includes(y)).reduce((y,T)=>(y.add(T),y),new Set),c=w.filter(y=>!l.includes(y)).reduce((y,T)=>(y.add(T),y),new Set),m=new Set;for(const y of w){if(c.has(y))continue;const T=h[y],t=f[y];(0,I.equals)(T,t)||m.add(y)}return{added:d,removed:c,updated:m}}function P(h={},f={}){const{added:w,removed:l,updated:d}=S(h,f);return w.size===0&&l.size===0&&d.size===0}function p(h){return{...h,disabled:!!h.disabled,installed:!!h.installed}}function g(h,f){const w={...h,identifier:{id:h.identifier.id,uuid:f.startsWith("uuid:")?f.substring(5):void 0},preRelease:!!h.preRelease,pinned:!!h.pinned};return h.disabled||delete w.disabled,h.installed||delete w.installed,h.state||delete w.state,h.isApplicationScoped||delete w.isApplicationScoped,w}}),define(ce[112],le([0,1,20,18,4]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IgnoredExtensionsManagementService=e.IIgnoredExtensionsManagementService=void 0,e.IIgnoredExtensionsManagementService=(0,A.createDecorator)("IIgnoredExtensionsManagementService");let _=class{constructor(D){this.configurationService=D}hasToNeverSyncExtension(D){return this.getConfiguredIgnoredExtensions().includes(D.toLowerCase())}hasToAlwaysSyncExtension(D){return this.getConfiguredIgnoredExtensions().includes(`-${D.toLowerCase()}`)}updateIgnoredExtensions(D,b){let S=[...this.configurationService.getValue("settingsSync.ignoredExtensions")].map(P=>P.toLowerCase());return S=S.filter(P=>P!==D&&P!==`-${D}`),b&&S.push(D.toLowerCase()),this.configurationService.updateValue("settingsSync.ignoredExtensions",S.length?S:void 0,2)}updateSynchronizedExtensions(D,b){let S=[...this.configurationService.getValue("settingsSync.ignoredExtensions")].map(P=>P.toLowerCase());return S=S.filter(P=>P!==D&&P!==`-${D}`),b&&S.push(`-${D.toLowerCase()}`),this.configurationService.updateValue("settingsSync.ignoredExtensions",S.length?S:void 0,2)}getIgnoredExtensions(D){const b=D.filter(g=>g.isMachineScoped).map(g=>g.identifier.id.toLowerCase()),S=this.getConfiguredIgnoredExtensions().map(g=>g.toLowerCase()),P=[],p=[];if(Array.isArray(S))for(const g of S)g.startsWith("-")?p.push(g.substring(1)):P.push(g);return(0,I.distinct)([...b,...P].filter(g=>!p.includes(g)))}getConfiguredIgnoredExtensions(){let D=this.configurationService.inspect("settingsSync.ignoredExtensions").userValue;return D!==void 0||(D=this.configurationService.inspect("sync.ignoredExtensions").userValue,D!==void 0)?D:(this.configurationService.getValue("settingsSync.ignoredExtensions")||[]).map(b=>b.toLowerCase())}};e.IgnoredExtensionsManagementService=_,e.IgnoredExtensionsManagementService=_=Ee([G(0,O.IConfigurationService)],_)}),define(ce[233],le([0,1,20,34,30,96,77]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;function D(y){return(0,O.parse)(y)||[]}async function b(y,T,t,o,n){const s=D(y),i=D(T),r=t?D(t):null,a=[...s,...i,...r||[]].map(H=>H.key),E=await n.resolveUserBindings(a),v=P(s,i,r,E);if(!v.hasLocalForwarded&&!v.hasRemoteForwarded)return{mergeContent:y,hasChanges:!1,hasConflicts:!1};if(!v.hasLocalForwarded&&v.hasRemoteForwarded)return{mergeContent:T,hasChanges:!0,hasConflicts:!1};if(v.hasLocalForwarded&&!v.hasRemoteForwarded)return{mergeContent:y,hasChanges:!0,hasConflicts:!1};const u=g(s),C=g(i),U=r?g(r):null,F=f(u,C,E),M=U?f(U,u,E):{added:[...u.keys()].reduce((H,Y)=>(H.add(Y),H),new Set),removed:new Set,updated:new Set},z=U?f(U,C,E):{added:[...C.keys()].reduce((H,Y)=>(H.add(Y),H),new Set),removed:new Set,updated:new Set},V=S(F,M,z);let J=y;for(const H of V.removed.values())V.conflicts.has(H)||(J=c(J,H,o));for(const H of V.added.values()){if(V.conflicts.has(H))continue;const Y=C.get(H);if(Y.some(B=>B.command!==`-${H}`&&v.conflicts.has(E[B.key]))){V.conflicts.add(H);continue}J=d(J,Y,o)}for(const H of V.updated.values()){if(V.conflicts.has(H))continue;const Y=C.get(H);if(Y.some(B=>B.command!==`-${H}`&&v.conflicts.has(E[B.key]))){V.conflicts.add(H);continue}J=m(J,H,Y,o)}return{mergeContent:J,hasChanges:!0,hasConflicts:V.conflicts.size>0}}e.merge=b;function S(y,T,t){const o=new Set,n=new Set,s=new Set,i=new Set;for(const r of T.removed.values())t.updated.has(r)&&i.add(r);for(const r of t.removed.values())i.has(r)||(T.updated.has(r)?i.add(r):n.add(r));for(const r of T.added.values())i.has(r)||t.added.has(r)&&y.updated.has(r)&&i.add(r);for(const r of t.added.values())i.has(r)||(T.added.has(r)?y.updated.has(r)&&i.add(r):o.add(r));for(const r of T.updated.values())i.has(r)||t.updated.has(r)&&y.updated.has(r)&&i.add(r);for(const r of t.updated.values())i.has(r)||(T.updated.has(r)?y.updated.has(r)&&i.add(r):s.add(r));return{added:o,removed:n,updated:s,conflicts:i}}function P(y,T,t,o){const n=new Set,s=p(y,o),i=p(T,o),r=t?p(t,o):null,a=h(s,i);if(a.added.size===0&&a.removed.size===0&&a.updated.size===0)return{hasLocalForwarded:!1,hasRemoteForwarded:!1,added:n,removed:n,updated:n,conflicts:n};const E=r?h(r,s):{added:[...s.keys()].reduce((M,z)=>(M.add(z),M),new Set),removed:new Set,updated:new Set};if(E.added.size===0&&E.removed.size===0&&E.updated.size===0)return{hasLocalForwarded:!1,hasRemoteForwarded:!0,added:n,removed:n,updated:n,conflicts:n};const v=r?h(r,i):{added:[...i.keys()].reduce((M,z)=>(M.add(z),M),new Set),removed:new Set,updated:new Set};if(v.added.size===0&&v.removed.size===0&&v.updated.size===0)return{hasLocalForwarded:!0,hasRemoteForwarded:!1,added:n,removed:n,updated:n,conflicts:n};const{added:u,removed:C,updated:U,conflicts:F}=S(a,E,v);return{hasLocalForwarded:!0,hasRemoteForwarded:!0,added:u,removed:C,updated:U,conflicts:F}}function p(y,T){const t=new Map;for(const o of y){const n=T[o.key];let s=t.get(n);s||(s=[],t.set(n,s)),s.push(o)}return t}function g(y){const T=new Map;for(const t of y){const o=t.command[0]==="-"?t.command.substring(1):t.command;let n=T.get(o);n||(n=[],T.set(o,n)),n.push(t)}return T}function h(y,T){const t=[...y.keys()],o=[...T.keys()],n=o.filter(r=>!t.includes(r)).reduce((r,a)=>(r.add(a),r),new Set),s=t.filter(r=>!o.includes(r)).reduce((r,a)=>(r.add(a),r),new Set),i=new Set;for(const r of t){if(s.has(r))continue;const a=y.get(r).map(v=>({...v,key:r})),E=T.get(r).map(v=>({...v,key:r}));(0,I.equals)(a,E,(v,u)=>l(v,u))||i.add(r)}return{added:n,removed:s,updated:i}}function f(y,T,t){const o=[...y.keys()],n=[...T.keys()],s=n.filter(a=>!o.includes(a)).reduce((a,E)=>(a.add(E),a),new Set),i=o.filter(a=>!n.includes(a)).reduce((a,E)=>(a.add(E),a),new Set),r=new Set;for(const a of o){if(i.has(a))continue;const E=y.get(a).map(u=>({...u,key:t[u.key]})),v=T.get(a).map(u=>({...u,key:t[u.key]}));w(E,v)||r.add(a)}return{added:s,removed:i,updated:r}}function w(y,T){return!(!(0,I.equals)(y.filter(({command:t})=>t[0]!=="-"),T.filter(({command:t})=>t[0]!=="-"),(t,o)=>l(t,o))||!(0,I.equals)(y.filter(({command:t})=>t[0]==="-"),T.filter(({command:t})=>t[0]==="-"),(t,o)=>l(t,o)))}function l(y,T){if(y.command!==T.command||y.key!==T.key)return!1;const t=_.ContextKeyExpr.deserialize(y.when),o=_.ContextKeyExpr.deserialize(T.when);return!(t&&!o||!t&&o||t&&o&&!t.equals(o)||!A.equals(y.args,T.args))}function d(y,T,t){for(const o of T)y=k.edit(y,[-1],o,t);return y}function c(y,T,t){const o=D(y);for(let n=o.length-1;n>=0;n--)(o[n].command===T||o[n].command===`-${T}`)&&(y=k.edit(y,[n],void 0,t));return y}function m(y,T,t,o){const n=D(y),s=n.findIndex(i=>i.command===T||i.command===`-${T}`);for(let i=n.length-1;i>=0;i--)(n[i].command===T||n[i].command===`-${T}`)&&(y=k.edit(y,[i],void 0,o));for(let i=t.length-1;i>=0;i--)y=k.edit(y,[s],t[i],o);return y}}),define(ce[234],le([0,1]),function(te,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.areSame=e.merge=void 0;function I(_,k,D){const b={},S={},P=new Set;if(!k)return{local:{added:b,updated:S,removed:[...P.values()]},remote:{added:_,updated:{},removed:[]},conflicts:[]};const p=O(_,k);if(p.added.size===0&&p.removed.size===0&&p.updated.size===0)return{local:{added:b,updated:S,removed:[...P.values()]},remote:{added:{},updated:{},removed:[]},conflicts:[]};const g=O(D,_),h=O(D,k),f={},w={},l=new Set,d=new Set;for(const c of g.removed.values())h.updated.has(c)?b[c]=k[c]:l.add(c);for(const c of h.removed.values())d.has(c)||(g.updated.has(c)?d.add(c):P.add(c));for(const c of g.updated.values())d.has(c)||(h.updated.has(c)?p.updated.has(c)&&d.add(c):w[c]=_[c]);for(const c of h.updated.values())d.has(c)||(g.updated.has(c)?p.updated.has(c)&&d.add(c):_[c]!==void 0&&(S[c]=k[c]));for(const c of g.added.values())d.has(c)||(h.added.has(c)?p.updated.has(c)&&d.add(c):f[c]=_[c]);for(const c of h.added.values())d.has(c)||(g.added.has(c)?p.updated.has(c)&&d.add(c):b[c]=k[c]);return{local:{added:b,removed:[...P.values()],updated:S},remote:{added:f,removed:[...l.values()],updated:w},conflicts:[...d.values()]}}e.merge=I;function O(_,k){const D=_?Object.keys(_):[],b=k?Object.keys(k):[],S=b.filter(g=>!D.includes(g)).reduce((g,h)=>(g.add(h),g),new Set),P=D.filter(g=>!b.includes(g)).reduce((g,h)=>(g.add(h),g),new Set),p=new Set;for(const g of D){if(P.has(g))continue;const h=_[g],f=k[g];h!==f&&p.add(g)}return{added:S,removed:P,updated:p}}function A(_,k){const{added:D,removed:b,updated:S}=O(_,k);return D.size===0&&b.size===0&&S.size===0}e.areSame=A}),define(ce[235],le([0,1,30]),function(te,e,I){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;function O(_,k,D,b){const S={added:[],removed:[],updated:[]};let P={added:[],removed:[],updated:[]};if(!k){const g=_.filter(({id:h})=>!b.includes(h));return g.length?P.added=g:P=null,{local:S,remote:P}}const p=A(_,k,b);if(p.added.length>0||p.removed.length>0||p.updated.length>0){const g=A(D,_,b),h=A(D,k,b);for(const f of h.removed){const w=_.find(l=>l.id===f);w&&S.removed.push(w)}for(const f of h.added){const w=k.find(l=>l.id===f);g.added.includes(f)?p.updated.includes(f)&&S.updated.push(w):S.added.push(w)}for(const f of h.updated)S.updated.push(k.find(w=>w.id===f));for(const f of g.added)h.added.includes(f)||P.added.push(_.find(w=>w.id===f));for(const f of g.updated)h.removed.includes(f)||h.updated.includes(f)||P.updated.push(_.find(w=>w.id===f));for(const f of g.removed){const w=k.find(l=>l.id===f);w&&P.removed.push(w)}}return P.added.length===0&&P.removed.length===0&&P.updated.length===0&&(P=null),{local:S,remote:P}}e.merge=O;function A(_,k,D){_=_?_.filter(({id:h})=>!D.includes(h)):[],k=k.filter(({id:h})=>!D.includes(h));const b=_.map(({id:h})=>h),S=k.map(({id:h})=>h),P=S.filter(h=>!b.includes(h)),p=b.filter(h=>!S.includes(h)),g=[];for(const{id:h,name:f,shortName:w,useDefaultFlags:l}of _){if(p.includes(h))continue;const d=k.find(c=>c.id===h);(!d||d.name!==f||d.shortName!==w||!(0,I.equals)(d.useDefaultFlags,l))&&g.push(h)}return{added:P,removed:p,updated:g}}}),define(ce[24],le([0,1,20,12,174,49,29,4,104,40]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PREVIEW_DIR_NAME=e.USER_DATA_SYNC_SCHEME=e.USER_DATA_SYNC_LOG_ID=e.IUserDataSyncLogService=e.IUserDataSyncUtilService=e.IUserDataAutoSyncService=e.IUserDataSyncResourceProviderService=e.IUserDataSyncService=e.IUserDataSyncEnablementService=e.getEnablementKey=e.SYNC_SERVICE_URL_TYPE=e.MergeState=e.Change=e.SyncStatus=e.UserDataAutoSyncError=e.UserDataSyncStoreError=e.UserDataSyncError=e.UserDataSyncErrorCode=e.createSyncHeaders=e.HEADER_EXECUTION_ID=e.HEADER_OPERATION_ID=e.IUserDataSyncBackupStoreService=e.IUserDataSyncStoreService=e.IUserDataSyncStoreManagementService=e.getLastSyncResourceUri=e.getPathSegments=e.ALL_SYNC_RESOURCES=e.SyncResource=e.isAuthenticationProvider=e.registerConfiguration=e.CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM=e.USER_DATA_SYNC_CONFIGURATION_SCOPE=e.getDefaultIgnoredSettings=e.getDisallowedIgnoredSettings=void 0;function P(){const i=S.Registry.as(_.Extensions.Configuration).getConfigurationProperties();return Object.keys(i).filter(r=>!!i[r].disallowSyncIgnore)}e.getDisallowedIgnoredSettings=P;function p(){const i=S.Registry.as(_.Extensions.Configuration).getConfigurationProperties(),r=Object.keys(i).filter(v=>!!i[v].ignoreSync),a=Object.keys(i).filter(v=>i[v].scope===2||i[v].scope===6),E=P();return(0,I.distinct)([...r,...a,...E])}e.getDefaultIgnoredSettings=p,e.USER_DATA_SYNC_CONFIGURATION_SCOPE="settingsSync",e.CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM="settingsSync.keybindingsPerPlatform";function g(){const i="vscode://schemas/ignoredSettings",r=S.Registry.as(_.Extensions.Configuration);r.registerConfiguration({id:"settingsSync",order:30,title:(0,A.localize)(0,null),type:"object",properties:{[e.CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM]:{type:"boolean",description:(0,A.localize)(1,null),default:!0,scope:1,tags:["sync","usesOnlineServices"]},"settingsSync.ignoredExtensions":{type:"array",markdownDescription:(0,A.localize)(2,null),items:[{type:"string",pattern:k.EXTENSION_IDENTIFIER_PATTERN,errorMessage:(0,A.localize)(3,null)}],default:[],scope:1,uniqueItems:!0,disallowSyncIgnore:!0,tags:["sync","usesOnlineServices"]},"settingsSync.ignoredSettings":{type:"array",description:(0,A.localize)(4,null),default:[],scope:1,$ref:i,additionalProperties:!0,uniqueItems:!0,disallowSyncIgnore:!0,tags:["sync","usesOnlineServices"]}}});const a=S.Registry.as(b.Extensions.JSONContribution),E=()=>{const v=P(),u=p(),C=Object.keys(_.allSettings.properties).filter(M=>!u.includes(M)),U=u.filter(M=>!v.includes(M)),F={items:{type:"string",enum:[...C,...U.map(M=>`-${M}`)]}};a.registerSchema(i,F)};return r.onDidUpdateConfiguration(()=>E())}e.registerConfiguration=g;function h(i){return i&&(0,O.isObject)(i)&&(0,O.isString)(i.id)&&Array.isArray(i.scopes)}e.isAuthenticationProvider=h;var f;(function(i){i.Settings="settings",i.Keybindings="keybindings",i.Snippets="snippets",i.Tasks="tasks",i.Extensions="extensions",i.GlobalState="globalState",i.Profiles="profiles",i.WorkspaceState="workspaceState"})(f||(e.SyncResource=f={})),e.ALL_SYNC_RESOURCES=["settings","keybindings","snippets","tasks","extensions","globalState","profiles"];function w(i,...r){return i?[i,...r]:r}e.getPathSegments=w;function l(i,r,a,E){return E.joinPath(a.userDataSyncHome,...w(i,r,`lastSync${r}.json`))}e.getLastSyncResourceUri=l,e.IUserDataSyncStoreManagementService=(0,D.createDecorator)("IUserDataSyncStoreManagementService"),e.IUserDataSyncStoreService=(0,D.createDecorator)("IUserDataSyncStoreService"),e.IUserDataSyncBackupStoreService=(0,D.createDecorator)("IUserDataSyncBackupStoreService"),e.HEADER_OPERATION_ID="x-operation-id",e.HEADER_EXECUTION_ID="X-Execution-Id";function d(i){const r={};return r[e.HEADER_EXECUTION_ID]=i,r}e.createSyncHeaders=d;var c;(function(i){i.Unauthorized="Unauthorized",i.Forbidden="Forbidden",i.NotFound="NotFound",i.MethodNotFound="MethodNotFound",i.Conflict="Conflict",i.Gone="Gone",i.PreconditionFailed="PreconditionFailed",i.TooLarge="TooLarge",i.UpgradeRequired="UpgradeRequired",i.PreconditionRequired="PreconditionRequired",i.TooManyRequests="RemoteTooManyRequests",i.TooManyRequestsAndRetryAfter="TooManyRequestsAndRetryAfter",i.RequestFailed="RequestFailed",i.RequestCanceled="RequestCanceled",i.RequestTimeout="RequestTimeout",i.RequestProtocolNotSupported="RequestProtocolNotSupported",i.RequestPathNotEscaped="RequestPathNotEscaped",i.RequestHeadersNotObject="RequestHeadersNotObject",i.NoCollection="NoCollection",i.NoRef="NoRef",i.EmptyResponse="EmptyResponse",i.TurnedOff="TurnedOff",i.SessionExpired="SessionExpired",i.ServiceChanged="ServiceChanged",i.DefaultServiceChanged="DefaultServiceChanged",i.LocalTooManyProfiles="LocalTooManyProfiles",i.LocalTooManyRequests="LocalTooManyRequests",i.LocalPreconditionFailed="LocalPreconditionFailed",i.LocalInvalidContent="LocalInvalidContent",i.LocalError="LocalError",i.IncompatibleLocalContent="IncompatibleLocalContent",i.IncompatibleRemoteContent="IncompatibleRemoteContent",i.Unknown="Unknown"})(c||(e.UserDataSyncErrorCode=c={}));class m extends Error{constructor(r,a,E,v){super(r),this.code=a,this.resource=E,this.operationId=v,this.name=`${this.code} (UserDataSyncError) syncResource:${this.resource||"unknown"} operationId:${this.operationId||"unknown"}`}}e.UserDataSyncError=m;class y extends m{constructor(r,a,E,v,u){super(r,E,void 0,u),this.url=a,this.serverCode=v}}e.UserDataSyncStoreError=y;class T extends m{constructor(r,a){super(r,a)}}e.UserDataAutoSyncError=T,function(i){function r(a){if(a instanceof i)return a;const E=/^(.+) \(UserDataSyncError\) syncResource:(.+) operationId:(.+)$/.exec(a.name);if(E&&E[1]){const v=E[2]==="unknown"?void 0:E[2],u=E[3]==="unknown"?void 0:E[3];return new i(a.message,E[1],v,u)}return new i(a.message,"Unknown")}i.toUserDataSyncError=r}(m||(e.UserDataSyncError=m={}));var t;(function(i){i.Uninitialized="uninitialized",i.Idle="idle",i.Syncing="syncing",i.HasConflicts="hasConflicts"})(t||(e.SyncStatus=t={}));var o;(function(i){i[i.None=0]="None",i[i.Added=1]="Added",i[i.Modified=2]="Modified",i[i.Deleted=3]="Deleted"})(o||(e.Change=o={}));var n;(function(i){i.Preview="preview",i.Conflict="conflict",i.Accepted="accepted"})(n||(e.MergeState=n={})),e.SYNC_SERVICE_URL_TYPE="sync.store.url.type";function s(i){return`sync.enable.${i}`}e.getEnablementKey=s,e.IUserDataSyncEnablementService=(0,D.createDecorator)("IUserDataSyncEnablementService"),e.IUserDataSyncService=(0,D.createDecorator)("IUserDataSyncService"),e.IUserDataSyncResourceProviderService=(0,D.createDecorator)("IUserDataSyncResourceProviderService"),e.IUserDataAutoSyncService=(0,D.createDecorator)("IUserDataAutoSyncService"),e.IUserDataSyncUtilService=(0,D.createDecorator)("IUserDataSyncUtilService"),e.IUserDataSyncLogService=(0,D.createDecorator)("IUserDataSyncLogService"),e.USER_DATA_SYNC_LOG_ID="userDataSync",e.USER_DATA_SYNC_SCHEME="vscode-userdata-sync",e.PREVIEW_DIR_NAME="preview"}),define(ce[236],le([0,1,30,24]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;function A(k,D,b,S,P){if(!D)return{remote:{added:Object.keys(k),removed:[],updated:[],all:Object.keys(k).length>0?k:null},local:{added:{},removed:[],updated:{}}};const p=_(k,D);if(p.added.size===0&&p.removed.size===0&&p.updated.size===0)return{remote:{added:[],removed:[],updated:[],all:null},local:{added:{},removed:[],updated:{}}};const g=b?_(b,D):{added:Object.keys(D).reduce((c,m)=>(c.add(m),c),new Set),removed:new Set,updated:new Set},h=b?_(b,k):{added:Object.keys(k).reduce((c,m)=>(c.add(m),c),new Set),removed:new Set,updated:new Set},f={added:{},removed:[],updated:{}},w=I.deepClone(D),l=!b;for(const c of h.added.values())c!==O.SYNC_SERVICE_URL_TYPE&&l&&g.added.has(c)||(w[c]=k[c]);for(const c of h.updated.values())w[c]=k[c];for(const c of h.removed.values())S.unregistered.includes(c)||delete w[c];for(const c of g.added.values()){const m=D[c];if(S.machine.includes(c)){P.info(`GlobalState: Skipped adding ${c} in local storage because it is declared as machine scoped.`);continue}if(b&&h.added.has(c))continue;const y=k[c];y&&y.value===m.value||c===O.SYNC_SERVICE_URL_TYPE&&l&&h.added.has(c)||(y?f.updated[c]=m:f.added[c]=m)}for(const c of g.updated.values()){const m=D[c];if(S.machine.includes(c)){P.info(`GlobalState: Skipped updating ${c} in local storage because it is declared as machine scoped.`);continue}if(h.updated.has(c)||h.removed.has(c))continue;const y=k[c];y&&y.value===m.value||(f.updated[c]=m)}for(const c of g.removed.values()){if(S.machine.includes(c)){P.trace(`GlobalState: Skipped removing ${c} in local storage because it is declared as machine scoped.`);continue}h.updated.has(c)||h.removed.has(c)||f.removed.push(c)}const d=_(D,w);return{local:f,remote:{added:[...d.added],updated:[...d.updated],removed:[...d.removed],all:d.added.size===0&&d.removed.size===0&&d.updated.size===0?null:w}}}e.merge=A;function _(k,D){const b=Object.keys(k),S=Object.keys(D),P=S.filter(h=>!b.includes(h)).reduce((h,f)=>(h.add(f),h),new Set),p=b.filter(h=>!S.includes(h)).reduce((h,f)=>(h.add(f),h),new Set),g=new Set;for(const h of b){if(p.has(h))continue;const f=k[h],w=D[h];I.equals(f,w)||g.add(h)}return{added:P,removed:p,updated:g}}}),define(ce[237],le([0,1,20,34,85,42,30,77,24]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addSetting=e.isEmpty=e.merge=e.updateIgnoredSettings=e.removeComments=e.getIgnoredSettings=void 0;function S(a,E,v){let u=[];v?u=p(v):u=P(E);const C=[],U=[...(0,b.getDisallowedIgnoredSettings)()];if(Array.isArray(u))for(const F of u)F.startsWith("-")?U.push(F.substring(1)):C.push(F);return(0,I.distinct)([...a,...C].filter(F=>!U.includes(F)))}e.getIgnoredSettings=S;function P(a){let E=a.inspect("settingsSync.ignoredSettings").userValue;return E!==void 0||(E=a.inspect("sync.ignoredSettings").userValue,E!==void 0)?E:a.getValue("settingsSync.ignoredSettings")||[]}function p(a){const E=(0,O.parse)(a);return E?E["settingsSync.ignoredSettings"]||E["sync.ignoredSettings"]||[]:[]}function g(a,E){const v=(0,O.parse)(a)||{};let u="{}";for(const C of Object.keys(v)){const U=(0,A.setProperty)(u,[C],v[C],E);u=(0,A.applyEdits)(u,U)}return u}e.removeComments=g;function h(a,E,v,u){if(v.length){const C=r(E),U=(0,O.parse)(E)||{},F=(0,O.parse)(a);if(!F)return a;const M=[];for(const z of v){const V=U[z],J=F[z];V===void 0?a=D.edit(a,[z],void 0,u):J!==void 0?a=D.edit(a,[z],V,u):M.push(t(z,C))}M.sort((z,V)=>z.startOffset-V.startOffset),M.forEach(z=>a=c(z.setting.key,E,a,u))}return a}e.updateIgnoredSettings=h;function f(a,E,v,u,C,U){const F=h(a,E,u,U),M=v!==F,z=v!==E;if(!M&&!z)return{conflictsSettings:[],localContent:null,remoteContent:null,hasConflicts:!1};if(M&&!z)return{conflictsSettings:[],localContent:null,remoteContent:F,hasConflicts:!1};if(z&&!M)return{conflictsSettings:[],localContent:h(E,a,u,U),remoteContent:null,hasConflicts:!1};if(v===null&&l(a)){const L=w(a,E,u)?null:h(E,a,u,U);return{conflictsSettings:[],localContent:L,remoteContent:null,hasConflicts:!1}}let V=a,J=E;const H=(0,O.parse)(a),Y=(0,O.parse)(E),B=v?(0,O.parse)(v):null,K=u.reduce((L,N)=>(L.add(N),L),new Set),x=d(H,Y,K),q=d(B,H,K),j=d(B,Y,K),Z=new Map,oe=new Set,ue=L=>{oe.add(L);const N=C.filter(({key:W})=>W===L)[0];N?(V=D.edit(V,[L],N.value,U),J=D.edit(J,[L],N.value,U)):Z.set(L,{key:L,localValue:H[L],remoteValue:Y[L]})};for(const L of q.removed.values())j.updated.has(L)?ue(L):J=D.edit(J,[L],void 0,U);for(const L of j.removed.values())oe.has(L)||(q.updated.has(L)?ue(L):V=D.edit(V,[L],void 0,U));for(const L of q.updated.values())oe.has(L)||(j.updated.has(L)?x.updated.has(L)&&ue(L):J=D.edit(J,[L],H[L],U));for(const L of j.updated.values())oe.has(L)||(q.updated.has(L)?x.updated.has(L)&&ue(L):V=D.edit(V,[L],Y[L],U));for(const L of q.added.values())oe.has(L)||(j.added.has(L)?x.updated.has(L)&&ue(L):J=c(L,V,J,U));for(const L of j.added.values())oe.has(L)||(q.added.has(L)?x.updated.has(L)&&ue(L):V=c(L,J,V,U));const ae=Z.size>0||!w(V,J,u),$=ae||!w(V,a,[]),R=ae||!w(J,E,[]);return{localContent:$?V:null,remoteContent:R?J:null,conflictsSettings:[...Z.values()],hasConflicts:ae}}e.merge=f;function w(a,E,v){if(a===E)return!0;const u=(0,O.parse)(a),C=(0,O.parse)(E),U=v.reduce((z,V)=>(z.add(V),z),new Set),F=r(a).filter(z=>!(z.setting&&U.has(z.setting.key))),M=r(E).filter(z=>!(z.setting&&U.has(z.setting.key)));if(F.length!==M.length)return!1;for(let z=0;z<F.length;z++){const V=F[z],J=M[z];if(V.setting&&J.setting){if(V.setting.key!==J.setting.key||!k.equals(u[V.setting.key],C[V.setting.key]))return!1}else if(!V.setting&&!J.setting){if(V.value!==J.value)return!1}else return!1}return!0}function l(a){return a?r(a).length===0:!0}e.isEmpty=l;function d(a,E,v){const u=a?Object.keys(a).filter(z=>!v.has(z)):[],C=Object.keys(E).filter(z=>!v.has(z)),U=C.filter(z=>!u.includes(z)).reduce((z,V)=>(z.add(V),z),new Set),F=u.filter(z=>!C.includes(z)).reduce((z,V)=>(z.add(V),z),new Set),M=new Set;if(a)for(const z of u){if(F.has(z))continue;const V=a[z],J=E[z];k.equals(V,J)||M.add(z)}return{added:U,removed:F,updated:M}}function c(a,E,v,u){const C=(0,O.parse)(E),U=r(E),F=r(v),M=m(a,U,F);return y(v,a,C[a],M,F,u)}e.addSetting=c;function m(a,E,v){const u=E.findIndex(U=>U.setting?.key===a),C=E[u-1];if(C){if(C.setting){const F=t(C.setting.key,v);if(F)return{index:v.indexOf(F),insertAfter:!0}}else{const F=o(u,E);if(F){const M=t(F.setting.key,v);if(M){const z=n(v.indexOf(M),v),V=s(E,F,E[u]);if(z){const J=s(v,M,z),H=i(V,J);return H?{index:v.indexOf(H),insertAfter:!0}:{index:v.indexOf(z),insertAfter:!1}}else{const J=s(v,M,v[v.length-1]),H=i(V,J);return H?{index:v.indexOf(H),insertAfter:!0}:{index:v.length-1,insertAfter:!0}}}}}const U=E[u+1];if(U)if(U.setting){const F=t(U.setting.key,v);if(F)return{index:v.indexOf(F),insertAfter:!1}}else{const F=n(u,E);if(F){const M=t(F.setting.key,v);if(M){const z=o(v.indexOf(M),v),V=s(E,E[u],F);if(z){const J=s(v,z,M),H=i(V.reverse(),J.reverse());return H?{index:v.indexOf(H),insertAfter:!1}:{index:v.indexOf(z),insertAfter:!0}}else{const J=s(v,v[0],M),H=i(V.reverse(),J.reverse());return H?{index:v.indexOf(H),insertAfter:!1}:{index:0,insertAfter:!1}}}}}}return{index:v.length-1,insertAfter:!0}}function y(a,E,v,u,C,U){let F;return u.index===-1?F=(0,A.setProperty)(a,[E],v,U):F=T(a,E,v,u,C,U).map(M=>(0,A.withFormatting)(a,M,U)[0]),(0,A.applyEdits)(a,F)}function T(a,E,v,u,C,U){const F=`${JSON.stringify(E)}: ${JSON.stringify(v)}`,M=(0,_.getEOL)(U,a),z=C[u.index];if(u.insertAfter){const V=[];if(z.setting)V.push({offset:z.endOffset,length:0,content:","+F});else{const J=n(u.index,C),H=o(u.index,C),Y=H?.setting?.commaOffset;H&&Y===void 0&&V.push({offset:H.endOffset,length:0,content:","});const B=Y!==void 0&&Y>z.endOffset;V.push({offset:B?Y+1:z.endOffset,length:0,content:J?M+F+",":M+F})}return V}else{if(z.setting)return[{offset:z.startOffset,length:0,content:F+","}];const V=(C[u.index-1]&&!C[u.index-1].setting?M:"")+F+(n(u.index,C)?",":"")+M;return[{offset:z.startOffset,length:0,content:V}]}}function t(a,E){return E.filter(v=>v.setting?.key===a)[0]}function o(a,E){for(let v=a-1;v>=0;v--)if(E[v].setting)return E[v]}function n(a,E){for(let v=a+1;v<E.length;v++)if(E[v].setting)return E[v]}function s(a,E,v){const u=a.indexOf(E),C=a.indexOf(v);return a.filter((U,F)=>u<F&&F<C)}function i(a,E){if(a.length&&E.length){let v=0;for(;v<E.length&&v<a.length;v++)if(a[v].value!==E[v].value)return E[v-1];return E[v-1]}}function r(a){const E=[];let v=-1,u,C;const U={onObjectBegin:F=>{v++},onObjectProperty:(F,M,z)=>{v===0&&(u=M,C=F)},onObjectEnd:(F,M)=>{v--,v===0&&E.push({startOffset:u,endOffset:F+M,value:a.substring(u,F+M),setting:{key:C,commaOffset:void 0}})},onArrayBegin:(F,M)=>{v++},onArrayEnd:(F,M)=>{v--,v===0&&E.push({startOffset:u,endOffset:F+M,value:a.substring(u,F+M),setting:{key:C,commaOffset:void 0}})},onLiteralValue:(F,M,z)=>{v===0&&E.push({startOffset:u,endOffset:M+z,value:a.substring(u,M+z),setting:{key:C,commaOffset:void 0}})},onSeparator:(F,M,z)=>{if(v===0&&F===","){let V=E.length-1;for(;V>=0&&!E[V].setting;V--);const J=E[V];J&&E.splice(V,1,{startOffset:J.startOffset,endOffset:J.endOffset,value:J.value,setting:{key:J.setting.key,commaOffset:M}})}},onComment:(F,M)=>{v===0&&E.push({startOffset:F,endOffset:F+M,value:a.substring(F,F+M)})}};return(0,O.visit)(a,U),E}}),define(ce[78],le([0,1,3,2,4,24]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncAccountService=e.IUserDataSyncAccountService=void 0,e.IUserDataSyncAccountService=(0,A.createDecorator)("IUserDataSyncAccountService");let k=class extends O.Disposable{get account(){return this._account}constructor(b,S){super(),this.userDataSyncStoreService=b,this.logService=S,this._onDidChangeAccount=this._register(new I.Emitter),this.onDidChangeAccount=this._onDidChangeAccount.event,this._onTokenFailed=this._register(new I.Emitter),this.onTokenFailed=this._onTokenFailed.event,this.wasTokenFailed=!1,this._register(b.onTokenFailed(P=>{this.logService.info("Settings Sync auth token failed",this.account?.authenticationProviderId,this.wasTokenFailed,P),this.updateAccount(void 0),P==="Forbidden"?this._onTokenFailed.fire(!0):this._onTokenFailed.fire(this.wasTokenFailed),this.wasTokenFailed=!0})),this._register(b.onTokenSucceed(()=>this.wasTokenFailed=!1))}async updateAccount(b){(b&&this._account?b.token!==this._account.token||b.authenticationProviderId!==this._account.authenticationProviderId:b!==this._account)&&(this._account=b,this._account&&this.userDataSyncStoreService.setAuthToken(this._account.token,this._account.authenticationProviderId),this._onDidChangeAccount.fire(b))}};e.UserDataSyncAccountService=k,e.UserDataSyncAccountService=k=Ee([G(0,_.IUserDataSyncStoreService),G(1,_.IUserDataSyncLogService)],k)}),define(ce[238],le([0,1,2,11]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncStoreManagementServiceChannelClient=e.UserDataSyncStoreManagementServiceChannel=e.UserDataSyncAccountServiceChannel=e.UserDataSyncMachinesServiceChannel=e.UserDataSyncUtilServiceClient=e.UserDataSycnUtilServiceChannel=e.UserDataAutoSyncChannel=void 0;class A{constructor(g){this.service=g}listen(g,h){switch(h){case"onError":return this.service.onError}throw new Error(`Event not found: ${h}`)}call(g,h,f){switch(h){case"triggerSync":return this.service.triggerSync(f[0],f[1],f[2]);case"turnOn":return this.service.turnOn();case"turnOff":return this.service.turnOff(f[0])}throw new Error("Invalid call")}}e.UserDataAutoSyncChannel=A;class _{constructor(g){this.service=g}listen(g,h){throw new Error(`Event not found: ${h}`)}call(g,h,f){switch(h){case"resolveDefaultIgnoredSettings":return this.service.resolveDefaultIgnoredSettings();case"resolveUserKeybindings":return this.service.resolveUserBindings(f[0]);case"resolveFormattingOptions":return this.service.resolveFormattingOptions(O.URI.revive(f[0]))}throw new Error("Invalid call")}}e.UserDataSycnUtilServiceChannel=_;class k{constructor(g){this.channel=g}async resolveDefaultIgnoredSettings(){return this.channel.call("resolveDefaultIgnoredSettings")}async resolveUserBindings(g){return this.channel.call("resolveUserKeybindings",[g])}async resolveFormattingOptions(g){return this.channel.call("resolveFormattingOptions",[g])}}e.UserDataSyncUtilServiceClient=k;class D{constructor(g){this.service=g}listen(g,h){switch(h){case"onDidChange":return this.service.onDidChange}throw new Error(`Event not found: ${h}`)}async call(g,h,f){switch(h){case"getMachines":return this.service.getMachines();case"addCurrentMachine":return this.service.addCurrentMachine();case"removeCurrentMachine":return this.service.removeCurrentMachine();case"renameMachine":return this.service.renameMachine(f[0],f[1]);case"setEnablements":return this.service.setEnablements(f)}throw new Error("Invalid call")}}e.UserDataSyncMachinesServiceChannel=D;class b{constructor(g){this.service=g}listen(g,h){switch(h){case"onDidChangeAccount":return this.service.onDidChangeAccount;case"onTokenFailed":return this.service.onTokenFailed}throw new Error(`Event not found: ${h}`)}call(g,h,f){switch(h){case"_getInitialData":return Promise.resolve(this.service.account);case"updateAccount":return this.service.updateAccount(f)}throw new Error("Invalid call")}}e.UserDataSyncAccountServiceChannel=b;class S{constructor(g){this.service=g}listen(g,h){switch(h){case"onDidChangeUserDataSyncStore":return this.service.onDidChangeUserDataSyncStore}throw new Error(`Event not found: ${h}`)}call(g,h,f){switch(h){case"switch":return this.service.switch(f[0]);case"getPreviousUserDataSyncStore":return this.service.getPreviousUserDataSyncStore()}throw new Error("Invalid call")}}e.UserDataSyncStoreManagementServiceChannel=S;class P extends I.Disposable{constructor(g){super(),this.channel=g,this.onDidChangeUserDataSyncStore=this.channel.listen("onDidChangeUserDataSyncStore")}async switch(g){return this.channel.call("switch",[g])}async getPreviousUserDataSyncStore(){const g=await this.channel.call("getPreviousUserDataSyncStore");return this.revive(g)}revive(g){return{url:O.URI.revive(g.url),type:g.type,defaultUrl:O.URI.revive(g.defaultUrl),insidersUrl:O.URI.revive(g.insidersUrl),stableUrl:O.URI.revive(g.stableUrl),canSwitch:g.canSwitch,authenticationProviders:g.authenticationProviders}}}e.UserDataSyncStoreManagementServiceChannelClient=P}),define(ce[239],le([0,1,175,7,24]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncLogService=void 0;let _=class extends O.AbstractLogger{constructor(D){super(),this.logger=this._register(D.createLogger(A.USER_DATA_SYNC_LOG_ID,{name:(0,I.localize)(0,null)}))}trace(D,...b){this.logger.trace(D,...b)}debug(D,...b){this.logger.debug(D,...b)}info(D,...b){this.logger.info(D,...b)}warn(D,...b){this.logger.warn(D,...b)}error(D,...b){this.logger.error(D,...b)}flush(){this.logger.flush()}};e.UserDataSyncLogService=_,e.UserDataSyncLogService=_=Ee([G(0,O.ILoggerService)],_)}),define(ce[113],le([0,1,7,4,23]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceRecognitionService=e.IVoiceRecognitionService=void 0,e.IVoiceRecognitionService=(0,O.createDecorator)("voiceRecognitionService");let _=class{constructor(D,b){this.logService=D,this.productService=b}async transcribe(D,b){this.logService.info(`[voice] transcribe(${D.length}): Begin`);const S=process.env.VSCODE_VOICE_MODULE_PATH;if(!S||this.productService.quality==="stable")throw this.logService.error(`[voice] transcribe(${D.length}): Voice recognition not yet supported`),new Error("Voice recognition not yet supported!");const P=Date.now();this.logService.info(`[voice] transcribe(${D.length}): Getting module from ${S}`);try{const p=te.__$__nodeRequire(S),g=new AbortController;b.onCancellationRequested(()=>g.abort());const h=await p.transcribe({samplingRate:16e3,bitDepth:16,channelCount:1,channelData:D},{language:"en",suppressNonSpeechTokens:!0,signal:g.signal});return this.logService.info(`[voice] transcribe(${D.length}): End (text: "${h}", took: ${Date.now()-P}ms)`),h}catch(p){throw this.logService.error(`[voice] transcribe(${D.length}): Failed (error: "${p}", took: ${Date.now()-P}ms)`),p}}};e.VoiceRecognitionService=_,e.VoiceRecognitionService=_=Ee([G(0,I.ILogService),G(1,A.IProductService)],_)}),define(ce[240],le([0,1,2,113,7,25,5]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VoiceTranscriptionManager=void 0;let D=class extends I.Disposable{constructor(P,p,g){super(),this.onDidWindowConnectRaw=P,this.voiceRecognitionService=p,this.logService=g,this.registerListeners()}registerListeners(){this._register(this.onDidWindowConnectRaw(P=>{this._register(new b(P,this.voiceRecognitionService,this.logService))}))}};e.VoiceTranscriptionManager=D,e.VoiceTranscriptionManager=D=Ee([G(1,O.IVoiceRecognitionService),G(2,A.ILogService)],D);class b extends I.Disposable{static{this.MAX_DATA_LENGTH=30*16e3*16*1/8}constructor(P,p,g){super(),this.port=P,this.voiceRecognitionService=p,this.logService=g,this.transcriptionQueue=new k.LimitedQueue,this.data=void 0,this.registerListeners()}registerListeners(){this.logService.info("[voice] transcriber: new connection");const P=new _.CancellationTokenSource;this._register((0,I.toDisposable)(()=>P.dispose(!0)));const p=g=>this.handleRequest(g,P.token);this.port.on("message",p),this._register((0,I.toDisposable)(()=>this.port.off("message",p))),this.port.start(),this._register((0,I.toDisposable)(()=>this.port.close())),this.port.on("close",()=>{this.logService.info("[voice] transcriber: closed connection"),P.dispose(!0)})}async handleRequest(P,p){if(!Array.isArray(P.data))return;const g=[];for(const f of P.data)f instanceof Float32Array&&g.push(f);const h=this.joinFloat32Arrays(this.data?[this.data,...g]:g);if(h.length>b.MAX_DATA_LENGTH){this.logService.warn("[voice] transcriber: refusing to accept more than 30s of audio data");return}this.data=h,this.transcriptionQueue.queue(()=>this.transcribe(p))}async transcribe(P){if(P.isCancellationRequested)return;const p=this.data?.slice(0);if(!p)return;const g=await this.voiceRecognitionService.transcribe(p,P);P.isCancellationRequested||this.port.postMessage(g)}joinFloat32Arrays(P){const p=new Float32Array(P.reduce((h,f)=>h+f.length,0));let g=0;for(const h of P)p.set(h,g),g+=h.length;return p}}}),define(ce[241],le([0,1,5,3,2]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ActiveWindowManager=void 0;class _ extends A.Disposable{constructor({onDidOpenWindow:D,onDidFocusWindow:b,getActiveWindowId:S}){super(),this.disposables=this._register(new A.DisposableStore),O.Event.latch(O.Event.any(D,b))(this.setActiveWindow,this,this.disposables),this.firstActiveWindowIdPromise=(0,I.createCancelablePromise)(()=>S()),(async()=>{try{const p=await this.firstActiveWindowIdPromise;this.activeWindowId=typeof this.activeWindowId=="number"?this.activeWindowId:p}catch{}finally{this.firstActiveWindowIdPromise=void 0}})()}setActiveWindow(D){this.firstActiveWindowIdPromise&&(this.firstActiveWindowIdPromise.cancel(),this.firstActiveWindowIdPromise=void 0),this.activeWindowId=D}async getActiveClientId(){return`window:${this.firstActiveWindowIdPromise?await this.firstActiveWindowIdPromise:this.activeWindowId}`}}e.ActiveWindowManager=_}),define(ce[114],le([0,1,178,16,47,22,11,4,26]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasWorkspaceFileExtension=e.isSavedWorkspace=e.isStandaloneEditorWorkspace=e.STANDALONE_EDITOR_WORKSPACE_ID=e.isTemporaryWorkspace=e.isUntitledWorkspace=e.UNTITLED_WORKSPACE_NAME=e.WORKSPACE_FILTER=e.WORKSPACE_SUFFIX=e.WORKSPACE_EXTENSION=e.toWorkspaceFolder=e.WorkspaceFolder=e.Workspace=e.isWorkspaceFolder=e.isWorkspace=e.WorkbenchState=e.reviveIdentifier=e.isWorkspaceIdentifier=e.toWorkspaceIdentifier=e.UNKNOWN_EMPTY_WINDOW_WORKSPACE=e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE=e.isEmptyWorkspaceIdentifier=e.isSingleFolderWorkspaceIdentifier=e.IWorkspaceContextService=void 0,e.IWorkspaceContextService=(0,D.createDecorator)("contextService");function S(s){const i=s;return typeof i?.id=="string"&&k.URI.isUri(i.uri)}e.isSingleFolderWorkspaceIdentifier=S;function P(s){return typeof s?.id=="string"&&!S(s)&&!g(s)}e.isEmptyWorkspaceIdentifier=P,e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE={id:"ext-dev"},e.UNKNOWN_EMPTY_WINDOW_WORKSPACE={id:"empty-window"};function p(s,i){if(typeof s=="string"||typeof s>"u")return typeof s=="string"?{id:(0,O.basename)(s)}:i?e.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE:e.UNKNOWN_EMPTY_WINDOW_WORKSPACE;const r=s;return r.configuration?{id:r.id,configPath:r.configuration}:r.folders.length===1?{id:r.id,uri:r.folders[0].uri}:{id:r.id}}e.toWorkspaceIdentifier=p;function g(s){const i=s;return typeof i?.id=="string"&&k.URI.isUri(i.configPath)}e.isWorkspaceIdentifier=g;function h(s){const i=s;if(i?.uri)return{id:i.id,uri:k.URI.revive(i.uri)};const r=s;if(r?.configPath)return{id:r.id,configPath:k.URI.revive(r.configPath)};if(s?.id)return{id:s.id}}e.reviveIdentifier=h;var f;(function(s){s[s.EMPTY=1]="EMPTY",s[s.FOLDER=2]="FOLDER",s[s.WORKSPACE=3]="WORKSPACE"})(f||(e.WorkbenchState=f={}));function w(s){const i=s;return!!(i&&typeof i=="object"&&typeof i.id=="string"&&Array.isArray(i.folders))}e.isWorkspace=w;function l(s){const i=s;return!!(i&&typeof i=="object"&&k.URI.isUri(i.uri)&&typeof i.name=="string"&&typeof i.toResource=="function")}e.isWorkspaceFolder=l;class d{constructor(i,r,a,E,v){this._id=i,this._transient=a,this._configuration=E,this._ignorePathCasing=v,this._foldersMap=A.TernarySearchTree.forUris(this._ignorePathCasing,()=>!0),this.folders=r}update(i){this._id=i.id,this._configuration=i.configuration,this._transient=i.transient,this._ignorePathCasing=i._ignorePathCasing,this.folders=i.folders}get folders(){return this._folders}set folders(i){this._folders=i,this.updateFoldersMap()}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(i){this._configuration=i}getFolder(i){return i&&this._foldersMap.findSubstr(i)||null}updateFoldersMap(){this._foldersMap=A.TernarySearchTree.forUris(this._ignorePathCasing,()=>!0);for(const i of this.folders)this._foldersMap.set(i.uri,i)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}}e.Workspace=d;class c{constructor(i,r){this.raw=r,this.uri=i.uri,this.index=i.index,this.name=i.name}toResource(i){return(0,_.joinPath)(this.uri,i)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}e.WorkspaceFolder=c;function m(s){return new c({uri:s,index:0,name:(0,_.basenameOrAuthority)(s)},{uri:s.toString()})}e.toWorkspaceFolder=m,e.WORKSPACE_EXTENSION="code-workspace",e.WORKSPACE_SUFFIX=`.${e.WORKSPACE_EXTENSION}`,e.WORKSPACE_FILTER=[{name:(0,I.localize)(0,null),extensions:[e.WORKSPACE_EXTENSION]}],e.UNTITLED_WORKSPACE_NAME="workspace.json";function y(s,i){return _.extUriBiasedIgnorePathCase.isEqualOrParent(s,i.untitledWorkspacesHome)}e.isUntitledWorkspace=y;function T(s){let i;return k.URI.isUri(s)?i=s:i=s.configuration,i?.scheme===b.Schemas.tmp}e.isTemporaryWorkspace=T,e.STANDALONE_EDITOR_WORKSPACE_ID="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function t(s){return s.id===e.STANDALONE_EDITOR_WORKSPACE_ID}e.isStandaloneEditorWorkspace=t;function o(s,i){return!y(s,i)&&!T(s)}e.isSavedWorkspace=o;function n(s){return(typeof s=="string"?(0,O.extname)(s):(0,_.extname)(s))===e.WORKSPACE_SUFFIX}e.hasWorkspaceFileExtension=n}),define(ce[17],le([0,1,51,3,2,22,11,169,15,13,4,7,114,35,27,5,32,28,12]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InMemoryUserDataProfilesService=e.UserDataProfilesService=e.toUserDataProfile=e.reviveProfile=e.IUserDataProfilesService=e.isUserDataProfile=e.ProfileResourceType=void 0;var m;(function(s){s.Settings="settings",s.Keybindings="keybindings",s.Snippets="snippets",s.Tasks="tasks",s.Extensions="extensions",s.GlobalState="globalState"})(m||(e.ProfileResourceType=m={}));function y(s){const i=s;return!!(i&&typeof i=="object"&&typeof i.id=="string"&&typeof i.isDefault=="boolean"&&typeof i.name=="string"&&k.URI.isUri(i.location)&&k.URI.isUri(i.globalStorageHome)&&k.URI.isUri(i.settingsResource)&&k.URI.isUri(i.keybindingsResource)&&k.URI.isUri(i.tasksResource)&&k.URI.isUri(i.snippetsHome)&&k.URI.isUri(i.extensionsResource))}e.isUserDataProfile=y,e.IUserDataProfilesService=(0,P.createDecorator)("IUserDataProfilesService");function T(s,i){return{id:s.id,isDefault:s.isDefault,name:s.name,shortName:s.shortName,location:k.URI.revive(s.location).with({scheme:i}),globalStorageHome:k.URI.revive(s.globalStorageHome).with({scheme:i}),settingsResource:k.URI.revive(s.settingsResource).with({scheme:i}),keybindingsResource:k.URI.revive(s.keybindingsResource).with({scheme:i}),tasksResource:k.URI.revive(s.tasksResource).with({scheme:i}),snippetsHome:k.URI.revive(s.snippetsHome).with({scheme:i}),extensionsResource:k.URI.revive(s.extensionsResource).with({scheme:i}),cacheHome:k.URI.revive(s.cacheHome).with({scheme:i}),useDefaultFlags:s.useDefaultFlags,isTransient:s.isTransient}}e.reviveProfile=T;function t(s,i,r,a,E,v){return{id:s,name:i,location:r,isDefault:!1,shortName:E?.shortName,globalStorageHome:v&&E?.useDefaultFlags?.globalState?v.globalStorageHome:(0,_.joinPath)(r,"globalStorage"),settingsResource:v&&E?.useDefaultFlags?.settings?v.settingsResource:(0,_.joinPath)(r,"settings.json"),keybindingsResource:v&&E?.useDefaultFlags?.keybindings?v.keybindingsResource:(0,_.joinPath)(r,"keybindings.json"),tasksResource:v&&E?.useDefaultFlags?.tasks?v.tasksResource:(0,_.joinPath)(r,"tasks.json"),snippetsHome:v&&E?.useDefaultFlags?.snippets?v.snippetsHome:(0,_.joinPath)(r,"snippets"),extensionsResource:v&&E?.useDefaultFlags?.extensions?v.extensionsResource:(0,_.joinPath)(r,"extensions.json"),cacheHome:(0,_.joinPath)(a,s),useDefaultFlags:E?.useDefaultFlags,isTransient:E?.transient}}e.toUserDataProfile=t;let o=class extends A.Disposable{static{this.PROFILES_KEY="userDataProfiles"}static{this.PROFILE_ASSOCIATIONS_KEY="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(i,r,a,E){super(),this.environmentService=i,this.fileService=r,this.uriIdentityService=a,this.logService=E,this.enabled=!0,this._onDidChangeProfiles=this._register(new O.Emitter),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new O.Emitter),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new O.Emitter),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new O.Emitter),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],workspaces:new h.ResourceMap,emptyWindows:new Map},this.profilesHome=(0,_.joinPath)(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=(0,_.joinPath)(this.environmentService.cacheHome,"CachedProfilesData")}init(){this._profilesObject=void 0}setEnablement(i){this.enabled!==i&&(this._profilesObject=void 0,this.enabled=i)}isEnabled(){return this.enabled}get profilesObject(){if(!this._profilesObject){const i=this.createDefaultProfile(),r=[i];if(this.enabled)try{for(const v of this.getStoredProfiles()){if(!v.name||!(0,c.isString)(v.name)||!v.location){this.logService.warn("Skipping the invalid stored profile",v.location||v.name);continue}r.push(t((0,_.basename)(v.location),v.name,v.location,this.profilesCacheHome,{shortName:v.shortName,useDefaultFlags:v.useDefaultFlags},i))}}catch(v){this.logService.error(v)}const a=new h.ResourceMap,E=new Map;if(r.length)try{const v=this.getStoredProfileAssociations();if(v.workspaces)for(const[u,C]of Object.entries(v.workspaces)){const U=k.URI.parse(u),F=r.find(M=>M.id===C);F&&a.set(U,F)}if(v.emptyWindows)for(const[u,C]of Object.entries(v.emptyWindows)){const U=r.find(F=>F.id===C);U&&E.set(u,U)}}catch(v){this.logService.error(v)}this._profilesObject={profiles:r,workspaces:a,emptyWindows:E}}return this._profilesObject}createDefaultProfile(){const i=t("__default__profile__",(0,D.localize)(0,null),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...i,extensionsResource:this.getDefaultProfileExtensionsLocation()??i.extensionsResource,isDefault:!0}}async createTransientProfile(i){const r="Temp",a=new RegExp(`${(0,d.escapeRegExpCharacters)(r)}\\s(\\d+)`);let E=0;for(const u of this.profiles){const C=a.exec(u.name),U=C?parseInt(C[1]):0;E=U>E?U:E}const v=`${r} ${E+1}`;return this.createProfile((0,I.hash)((0,l.generateUuid)()).toString(16),v,{transient:!0},i)}async createNamedProfile(i,r,a){return this.createProfile((0,I.hash)((0,l.generateUuid)()).toString(16),i,r,a)}async createProfile(i,r,a,E){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const v=await this.doCreateProfile(i,r,a);return E&&await this.setProfileForWorkspace(E,v),v}async doCreateProfile(i,r,a){if(!(0,c.isString)(r)||!r)throw new Error("Name of the profile is mandatory and must be of type `string`");let E=this.profileCreationPromises.get(r);return E||(E=(async()=>{try{const v=this.profiles.find(U=>U.name===r||U.id===i);if(v)return v;const u=t(i,r,(0,_.joinPath)(this.profilesHome,i),this.profilesCacheHome,a,this.defaultProfile);await this.fileService.createFolder(u.location);const C=[];return this._onWillCreateProfile.fire({profile:u,join(U){C.push(U)}}),await w.Promises.settled(C),this.updateProfiles([u],[],[]),u}finally{this.profileCreationPromises.delete(r)}})(),this.profileCreationPromises.set(r,E)),E}async updateProfile(i,r){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");let a=this.profiles.find(E=>E.id===i.id);if(!a)throw new Error(`Profile '${i.name}' does not exist`);return a=t(a.id,r.name??a.name,a.location,this.profilesCacheHome,{shortName:r.shortName??a.shortName,transient:r.transient??a.isTransient,useDefaultFlags:r.useDefaultFlags??a.useDefaultFlags},this.defaultProfile),this.updateProfiles([],[],[a]),a}async removeProfile(i){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");if(i.isDefault)throw new Error("Cannot remove default profile");const r=this.profiles.find(E=>E.id===i.id);if(!r)throw new Error(`Profile '${i.name}' does not exist`);const a=[];this._onWillRemoveProfile.fire({profile:r,join(E){a.push(E)}});try{await Promise.allSettled(a)}catch(E){this.logService.error(E)}for(const E of[...this.profilesObject.emptyWindows.keys()])r.id===this.profilesObject.emptyWindows.get(E)?.id&&this.profilesObject.emptyWindows.delete(E);for(const E of[...this.profilesObject.workspaces.keys()])r.id===this.profilesObject.workspaces.get(E)?.id&&this.profilesObject.workspaces.delete(E);this.updateStoredProfileAssociations(),this.updateProfiles([],[r],[]);try{await this.fileService.del(r.cacheHome,{recursive:!0})}catch(E){(0,S.toFileOperationResult)(E)!==1&&this.logService.error(E)}}async setProfileForWorkspace(i,r){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");const a=this.profiles.find(E=>E.id===r.id);if(!a)throw new Error(`Profile '${r.name}' does not exist`);this.updateWorkspaceAssociation(i,a)}unsetWorkspace(i,r){if(!this.enabled)throw new Error("Profiles are disabled in the current environment.");this.updateWorkspaceAssociation(i,void 0,r)}async resetWorkspaces(){this.transientProfilesObject.workspaces.clear(),this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.workspaces.clear(),this.profilesObject.emptyWindows.clear(),this.updateStoredProfileAssociations(),this._onDidResetWorkspaces.fire()}async cleanUp(){if(this.enabled&&await this.fileService.exists(this.profilesHome)){const i=await this.fileService.resolve(this.profilesHome);await Promise.all((i.children||[]).filter(r=>r.isDirectory&&this.profiles.every(a=>!this.uriIdentityService.extUri.isEqual(a.location,r.resource))).map(r=>this.fileService.del(r.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){if(!this.enabled)return;const i=this.transientProfilesObject.profiles.filter(r=>!this.isProfileAssociatedToWorkspace(r));await Promise.allSettled(i.map(r=>this.removeProfile(r)))}getProfileForWorkspace(i){const r=this.getWorkspace(i);return k.URI.isUri(r)?this.transientProfilesObject.workspaces.get(r)??this.profilesObject.workspaces.get(r):this.transientProfilesObject.emptyWindows.get(r)??this.profilesObject.emptyWindows.get(r)}getWorkspace(i){return(0,g.isSingleFolderWorkspaceIdentifier)(i)?i.uri:(0,g.isWorkspaceIdentifier)(i)?i.configPath:i.id}isProfileAssociatedToWorkspace(i){return!!([...this.transientProfilesObject.emptyWindows.values()].some(r=>this.uriIdentityService.extUri.isEqual(r.location,i.location))||[...this.transientProfilesObject.workspaces.values()].some(r=>this.uriIdentityService.extUri.isEqual(r.location,i.location))||[...this.profilesObject.emptyWindows.values()].some(r=>this.uriIdentityService.extUri.isEqual(r.location,i.location))||[...this.profilesObject.workspaces.values()].some(r=>this.uriIdentityService.extUri.isEqual(r.location,i.location)))}updateProfiles(i,r,a){const E=[...this.profiles,...i],v=[];this.transientProfilesObject.profiles=[];for(let u of E)u.isDefault||r.some(C=>u.id===C.id)||(u=a.find(C=>u.id===C.id)??u,u.isTransient?this.transientProfilesObject.profiles.push(u):v.push({location:u.location,name:u.name,shortName:u.shortName,useDefaultFlags:u.useDefaultFlags}));this.saveStoredProfiles(v),this._profilesObject=void 0,this.triggerProfilesChanges(i,r,a)}triggerProfilesChanges(i,r,a){this._onDidChangeProfiles.fire({added:i,removed:r,updated:a,all:this.profiles})}updateWorkspaceAssociation(i,r,a){a=r?.isTransient?!0:a,a||this.updateWorkspaceAssociation(i,void 0,!0);const E=this.getWorkspace(i),v=a?this.transientProfilesObject:this.profilesObject;k.URI.isUri(E)?(v.workspaces.delete(E),r&&v.workspaces.set(E,r)):(v.emptyWindows.delete(E),r&&v.emptyWindows.set(E,r)),a||this.updateStoredProfileAssociations()}updateStoredProfileAssociations(){const i={};for(const[a,E]of this.profilesObject.workspaces.entries())i[a.toString()]=E.id;const r={};for(const[a,E]of this.profilesObject.emptyWindows.entries())r[a.toString()]=E.id;this.saveStoredProfileAssociations({workspaces:i,emptyWindows:r}),this._profilesObject=void 0}migrateStoredProfileAssociations(i){const r={},a=this.createDefaultProfile();if(i.workspaces)for(const[v,u]of Object.entries(i.workspaces)){const C=k.URI.parse(u);r[v]=this.uriIdentityService.extUri.isEqual(C,a.location)?a.id:this.uriIdentityService.extUri.basename(C)}const E={};if(i.emptyWindows)for(const[v,u]of Object.entries(i.emptyWindows)){const C=k.URI.parse(u);E[v]=this.uriIdentityService.extUri.isEqual(C,a.location)?a.id:this.uriIdentityService.extUri.basename(C)}return{workspaces:r,emptyWindows:E}}getStoredProfiles(){return[]}saveStoredProfiles(i){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(i){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}};e.UserDataProfilesService=o,e.UserDataProfilesService=o=Ee([G(0,b.IEnvironmentService),G(1,S.IFileService),G(2,f.IUriIdentityService),G(3,p.ILogService)],o);class n extends o{constructor(){super(...arguments),this.storedProfiles=[],this.storedProfileAssociations={}}getStoredProfiles(){return this.storedProfiles}saveStoredProfiles(i){this.storedProfiles=i}getStoredProfileAssociations(){return this.storedProfileAssociations}saveStoredProfileAssociations(i){this.storedProfileAssociations=i}}e.InMemoryUserDataProfilesService=n}),define(ce[242],le([0,1,5,2,17]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataProfilesCleaner=void 0;let _=class extends O.Disposable{constructor(D){super(),this._register(new I.RunOnceScheduler(()=>{D.cleanUp()},10*1e3)).schedule()}};e.UserDataProfilesCleaner=_,e.UserDataProfilesCleaner=_=Ee([G(0,A.IUserDataProfilesService)],_)}),define(ce[243],le([0,1,20,5,25,8,3,2,6,12,11,152,29,33,41,7,23,21,27,17]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractExtensionTask=e.toExtensionManagementError=e.joinErrors=e.AbstractExtensionManagementService=void 0;let y=class extends D.Disposable{get onInstallExtension(){return this._onInstallExtension.event}get onDidInstallExtensions(){return this._onDidInstallExtensions.event}get onUninstallExtension(){return this._onUninstallExtension.event}get onDidUninstallExtension(){return this._onDidUninstallExtension.event}get onDidUpdateExtensionMetadata(){return this._onDidUpdateExtensionMetadata.event}constructor(i,r,a,E,v,u){super(),this.galleryService=i,this.telemetryService=r,this.uriIdentityService=a,this.logService=E,this.productService=v,this.userDataProfilesService=u,this.lastReportTimestamp=0,this.installingExtensions=new Map,this.uninstallingExtensions=new Map,this._onInstallExtension=this._register(new k.Emitter),this._onDidInstallExtensions=this._register(new k.Emitter),this._onUninstallExtension=this._register(new k.Emitter),this._onDidUninstallExtension=this._register(new k.Emitter),this._onDidUpdateExtensionMetadata=this._register(new k.Emitter),this.participants=[],this._register((0,D.toDisposable)(()=>{this.installingExtensions.forEach(({task:C})=>C.cancel()),this.uninstallingExtensions.forEach(C=>C.cancel()),this.installingExtensions.clear(),this.uninstallingExtensions.clear()}))}async canInstall(i){const r=await this.getTargetPlatform();return i.allTargetPlatforms.some(a=>(0,g.isTargetPlatformCompatible)(a,i.allTargetPlatforms,r))}async installFromGallery(i,r={}){try{const E=(await this.installGalleryExtensions([{extension:i,options:r}])).find(({identifier:v})=>(0,h.areSameExtensions)(v,i.identifier));if(E?.local)return E?.local;throw E?.error?E.error:t(new Error(`Unknown error while installing extension ${i.identifier.id}`))}catch(a){throw t(a)}}async installGalleryExtensions(i){if(!this.galleryService.isEnabled())throw new g.ExtensionManagementError(p.localize(0,null),g.ExtensionManagementErrorCode.Internal);const r=[],a=[];await Promise.allSettled(i.map(async({extension:E,options:v})=>{try{const u=await this.checkAndGetCompatibleVersion(E,!!v?.installGivenVersion,!!v?.installPreReleaseVersion);a.push({...u,options:v})}catch(u){r.push({identifier:E.identifier,operation:2,source:E,error:u})}})),a.length&&r.push(...await this.installExtensions(a));for(const E of r)E.error&&(this.logService.error("Failed to install extension.",E.identifier.id),this.logService.error(E.error),E.source&&!P.URI.isUri(E.source)&&o(this.telemetryService,"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(E.source),error:E.error}));return r}async uninstall(i,r={}){return this.logService.trace("ExtensionManagementService#uninstall",i.identifier.id),this.uninstallExtension(i,r)}async toggleAppliationScope(i,r){if((0,f.isApplicationScopedExtension)(i.manifest)||i.isBuiltin)return i;if(i.isApplicationScoped){let a=await this.updateMetadata(i,{isApplicationScoped:!1},this.userDataProfilesService.defaultProfile.extensionsResource);this.uriIdentityService.extUri.isEqual(r,this.userDataProfilesService.defaultProfile.extensionsResource)||(a=await this.copyExtension(i,this.userDataProfilesService.defaultProfile.extensionsResource,r));for(const E of this.userDataProfilesService.profiles){const v=(await this.getInstalled(1,E.extensionsResource)).find(u=>(0,h.areSameExtensions)(u.identifier,i.identifier));v?this._onDidUpdateExtensionMetadata.fire(v):this._onDidUninstallExtension.fire({identifier:i.identifier,profileLocation:E.extensionsResource})}return a}else{const a=this.uriIdentityService.extUri.isEqual(r,this.userDataProfilesService.defaultProfile.extensionsResource)?await this.updateMetadata(i,{isApplicationScoped:!0},this.userDataProfilesService.defaultProfile.extensionsResource):await this.copyExtension(i,r,this.userDataProfilesService.defaultProfile.extensionsResource,{isApplicationScoped:!0});return this._onDidInstallExtensions.fire([{identifier:a.identifier,operation:2,local:a,profileLocation:this.userDataProfilesService.defaultProfile.extensionsResource,applicationScoped:!0}]),a}}getExtensionsControlManifest(){const i=new Date().getTime();return(!this.extensionsControlManifest||i-this.lastReportTimestamp>1e3*60*5)&&(this.extensionsControlManifest=this.updateControlCache(),this.lastReportTimestamp=i),this.extensionsControlManifest}registerParticipant(i){this.participants.push(i)}async installExtensions(i){const r=[];return await Promise.allSettled(i.map(async a=>{try{const E=await this.installExtension(a);r.push(...E)}catch(E){r.push({identifier:{id:(0,h.getGalleryExtensionId)(a.manifest.publisher,a.manifest.name)},operation:2,source:a.extension,error:E})}})),this._onDidInstallExtensions.fire(r),r}async installExtension({manifest:i,extension:r,options:a}){const E=a.isApplicationScoped||a.isBuiltin||(0,f.isApplicationScopedExtension)(i),v={...a,installOnlyNewlyAddedFromExtensionPack:P.URI.isUri(r)?a.installOnlyNewlyAddedFromExtensionPack:!0,isApplicationScoped:E,profileLocation:E?this.userDataProfilesService.defaultProfile.extensionsResource:a.profileLocation??this.getCurrentExtensionsManifestLocation()},u=V=>`${h.ExtensionKey.create(V).toString()}${v.profileLocation?`-${v.profileLocation.toString()}`:""}`;if(!P.URI.isUri(r)){const V=this.installingExtensions.get(u(r));if(V)return this.logService.info("Extensions is already requested to install",r.identifier.id),await V.task.waitUntilTaskIsFinished(),[]}const C=[],U=[],F=[],M=this.createInstallExtensionTask(i,r,v);P.URI.isUri(r)||this.installingExtensions.set(u(r),{task:M,waitingTasks:[]}),this._onInstallExtension.fire({identifier:M.identifier,source:r,profileLocation:v.profileLocation}),this.logService.info("Installing extension:",M.identifier.id),C.push({task:M,manifest:i});let z=!1;try{if(v.donotIncludePackAndDependencies)this.logService.info("Installing the extension without checking dependencies and pack",M.identifier.id);else try{const J=await this.getAllDepsAndPackExtensions(M.identifier,i,!!v.installOnlyNewlyAddedFromExtensionPack,!!v.installPreReleaseVersion,v.profileLocation),H=await this.getInstalled(void 0,v.profileLocation),Y={...v,donotIncludePackAndDependencies:!0,context:{...v.context,[g.EXTENSION_INSTALL_DEP_PACK_CONTEXT]:!0}};for(const{gallery:B,manifest:K}of(0,I.distinct)(J,({gallery:x})=>x.identifier.id)){z=z||!!K.extensionDependencies?.some(j=>(0,h.areSameExtensions)({id:j},M.identifier));const x=u(B),q=this.installingExtensions.get(x);if(q){if(this.canWaitForTask(M,q.task)){const j=q.task.identifier;this.logService.info("Waiting for already requested installing extension",j.id,M.identifier.id),q.waitingTasks.push(M),U.push(k.Event.toPromise(k.Event.filter(this.onDidInstallExtensions,Z=>Z.some(oe=>(0,h.areSameExtensions)(oe.identifier,j)))).then(Z=>{if(this.logService.info("Finished waiting for already requested installing extension",j.id,M.identifier.id),!Z.find(ue=>(0,h.areSameExtensions)(ue.identifier,j))?.local)throw new Error(`Extension ${j.id} is not installed`)}))}}else if(!H.some(({identifier:j})=>(0,h.areSameExtensions)(j,B.identifier))){const j=this.createInstallExtensionTask(K,B,Y);this.installingExtensions.set(x,{task:j,waitingTasks:[M]}),this._onInstallExtension.fire({identifier:j.identifier,source:B,profileLocation:v.profileLocation}),this.logService.info("Installing extension:",j.identifier.id,M.identifier.id),C.push({task:j,manifest:K})}}}catch(J){if(P.URI.isUri(M.source))(0,I.isNonEmptyArray)(i.extensionDependencies)&&this.logService.warn("Cannot install dependencies of extension:",M.identifier.id,J.message),(0,I.isNonEmptyArray)(i.extensionPack)&&this.logService.warn("Cannot install packed extensions of extension:",M.identifier.id,J.message);else throw this.logService.error("Error while preparing to install dependencies and extension packs of the extension:",M.identifier.id),J}const V=C.reduce((J,{task:H,manifest:Y})=>(J.set(H.identifier.id.toLowerCase(),{task:H,manifest:Y}),J),new Map);for(;V.size;){let J;const H=[...V.values()].filter(({manifest:Y})=>!Y.extensionDependencies?.some(B=>V.has(B.toLowerCase())));H.length?J=V.size===1?H:H.filter(({task:Y})=>!(Y===M&&!z)):(this.logService.info("Found extensions with circular dependencies",H.map(({task:Y})=>Y.identifier.id)),J=[...V.values()]),await this.joinAllSettled(J.map(async({task:Y})=>{const B=new Date().getTime();try{const K=await Y.run();if(await this.joinAllSettled(this.participants.map(x=>x.postInstall(K,Y.source,v,A.CancellationToken.None))),!P.URI.isUri(Y.source)){const x=Y.operation===3,q=x?void 0:(new Date().getTime()-Y.source.lastUpdated)/1e3;if(o(this.telemetryService,x?"extensionGallery:update":"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(Y.source),verificationStatus:Y.verificationStatus,duration:new Date().getTime()-B,durationSinceUpdate:q}),b.isWeb&&Y.operation!==3)try{await this.galleryService.reportStatistic(K.manifest.publisher,K.manifest.name,K.manifest.version,"install")}catch{}}F.push({local:K,identifier:Y.identifier,operation:Y.operation,source:Y.source,context:Y.options.context,profileLocation:Y.profileLocation,applicationScoped:K.isApplicationScoped})}catch(K){throw P.URI.isUri(Y.source)||o(this.telemetryService,Y.operation===3?"extensionGallery:update":"extensionGallery:install",{extensionData:(0,h.getGalleryExtensionTelemetryData)(Y.source),verificationStatus:Y.verificationStatus,duration:new Date().getTime()-B,error:K}),this.logService.error("Error while installing the extension:",Y.identifier.id),K}finally{V.delete(Y.identifier.id.toLowerCase())}}))}return U.length&&await this.joinAllSettled(U),F.forEach(({identifier:J})=>this.logService.info("Extension installed successfully:",J.id)),F}catch(V){if(C.forEach(({task:J})=>J.cancel()),F.length)try{const J=await Promise.allSettled(F.map(({local:H})=>this.createUninstallExtensionTask(H,{versionOnly:!0,profileLocation:v.profileLocation}).run()));for(let H=0;H<J.length;H++){const Y=J[H],{identifier:B}=F[H];Y.status==="fulfilled"?this.logService.info("Rollback: Uninstalled extension",B.id):this.logService.warn("Rollback: Error while uninstalling extension",B.id,(0,_.getErrorMessage)(Y.reason))}}catch(J){this.logService.warn("Error while rolling back extensions",(0,_.getErrorMessage)(J),F.map(({identifier:H})=>H.id))}return C.map(({task:J})=>({identifier:J.identifier,operation:2,source:J.source,context:v.context,profileLocation:v.profileLocation,error:V}))}finally{for(const{task:V}of C)V.source&&!P.URI.isUri(V.source)&&this.installingExtensions.delete(u(V.source))}}canWaitForTask(i,r){for(const[,{task:a,waitingTasks:E}]of this.installingExtensions.entries())if(a===i&&(E.includes(r)||E.some(v=>this.canWaitForTask(v,r)))||a===r&&E[0]&&!this.canWaitForTask(i,E[0]))return!1;return!0}async joinAllSettled(i){const r=[],a=[],E=await Promise.allSettled(i);for(const v of E)v.status==="fulfilled"?r.push(v.value):a.push(v.reason);if(a.length)throw T(a);return r}async getAllDepsAndPackExtensions(i,r,a,E,v){if(!this.galleryService.isEnabled())return[];const u=await this.getInstalled(void 0,v),C=[],U=[],F=async(M,z)=>{C.push(M);const V=z.extensionDependencies||[],J=[...V];if(z.extensionPack){const H=a?u.find(Y=>(0,h.areSameExtensions)(Y.identifier,M)):void 0;for(const Y of z.extensionPack)H&&H.manifest.extensionPack&&H.manifest.extensionPack.some(B=>(0,h.areSameExtensions)({id:B},{id:Y}))||J.every(B=>!(0,h.areSameExtensions)({id:B},{id:Y}))&&J.push(Y)}if(J.length){const H=J.filter(Y=>C.every(B=>!(0,h.areSameExtensions)(B,{id:Y})));if(H.length){const Y=await this.galleryService.getExtensions(H.map(B=>({id:B,preRelease:E})),A.CancellationToken.None);for(const B of Y){if(C.find(q=>(0,h.areSameExtensions)(q,B.identifier)))continue;const K=V.some(q=>(0,h.areSameExtensions)({id:q},B.identifier));let x;try{x=await this.checkAndGetCompatibleVersion(B,!1,E)}catch(q){if(K)throw q;this.logService.info("Skipping the packed extension as it cannot be installed",B.identifier.id,(0,_.getErrorMessage)(q));continue}U.push({gallery:x.extension,manifest:x.manifest}),await F(x.extension.identifier,x.manifest)}}}};return await F(i,r),U}async checkAndGetCompatibleVersion(i,r,a){let E;const v=await this.getExtensionsControlManifest();if(v.malicious.some(U=>(0,h.areSameExtensions)(i.identifier,U)))throw new g.ExtensionManagementError(p.localize(1,null,i.identifier.id),g.ExtensionManagementErrorCode.Malicious);const u=v.deprecated[i.identifier.id.toLowerCase()];if(u?.extension?.autoMigrate){if(this.logService.info(`The '${i.identifier.id}' extension is deprecated, fetching the compatible '${u.extension.id}' extension instead.`),E=(await this.galleryService.getExtensions([{id:u.extension.id,preRelease:u.extension.preRelease}],{targetPlatform:await this.getTargetPlatform(),compatible:!0},A.CancellationToken.None))[0],!E)throw new g.ExtensionManagementError(p.localize(2,null,i.identifier.id,u.extension.id),g.ExtensionManagementErrorCode.Deprecated)}else{if(!await this.canInstall(i)){const U=await this.getTargetPlatform();throw new g.ExtensionManagementError(p.localize(3,null,i.identifier.id,this.productService.nameLong,(0,g.TargetPlatformToString)(U)),g.ExtensionManagementErrorCode.IncompatibleTargetPlatform)}if(E=await this.getCompatibleVersion(i,r,a),!E)throw!a&&i.properties.isPreReleaseVersion&&(await this.galleryService.getExtensions([i.identifier],A.CancellationToken.None))[0]?new g.ExtensionManagementError(p.localize(4,null,i.identifier.id),g.ExtensionManagementErrorCode.ReleaseVersionNotFound):new g.ExtensionManagementError(p.localize(5,null,i.identifier.id,this.productService.nameLong,this.productService.version),g.ExtensionManagementErrorCode.Incompatible)}this.logService.info("Getting Manifest...",E.identifier.id);const C=await this.galleryService.getManifest(E,A.CancellationToken.None);if(C===null)throw new g.ExtensionManagementError(`Missing manifest for extension ${E.identifier.id}`,g.ExtensionManagementErrorCode.Invalid);return{extension:E,manifest:C}}async getCompatibleVersion(i,r,a){const E=await this.getTargetPlatform();let v=null;return!r&&i.hasPreReleaseVersion&&i.properties.isPreReleaseVersion!==a&&(v=(await this.galleryService.getExtensions([{...i.identifier,preRelease:a}],{targetPlatform:E,compatible:!0},A.CancellationToken.None))[0]||null),!v&&await this.galleryService.isExtensionCompatible(i,a,E)&&(v=i),v||(r?v=(await this.galleryService.getExtensions([{...i.identifier,version:i.version}],{targetPlatform:E,compatible:!0},A.CancellationToken.None))[0]||null:v=await this.galleryService.getCompatibleExtension(i,a,E)),v}async uninstallExtension(i,r){const a={...r,profileLocation:i.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:r.profileLocation??this.getCurrentExtensionsManifestLocation()},E=M=>`${M.id.toLowerCase()}${a.versionOnly?`-${i.manifest.version}`:""}${a.profileLocation?`@${a.profileLocation.toString()}`:""}`,v=this.uninstallingExtensions.get(E(i.identifier));if(v)return this.logService.info("Extensions is already requested to uninstall",i.identifier.id),v.waitUntilTaskIsFinished();const u=M=>{const z=this.createUninstallExtensionTask(M,a);return this.uninstallingExtensions.set(E(z.extension.identifier),z),a.profileLocation?this.logService.info("Uninstalling extension from the profile:",`${M.identifier.id}@${M.manifest.version}`,a.profileLocation.toString()):this.logService.info("Uninstalling extension:",`${M.identifier.id}@${M.manifest.version}`),this._onUninstallExtension.fire({identifier:M.identifier,profileLocation:a.profileLocation,applicationScoped:M.isApplicationScoped}),z},C=(M,z)=>{z?a.profileLocation?this.logService.error("Failed to uninstall extension from the profile:",`${M.identifier.id}@${M.manifest.version}`,a.profileLocation.toString(),z.message):this.logService.error("Failed to uninstall extension:",`${M.identifier.id}@${M.manifest.version}`,z.message):a.profileLocation?this.logService.info("Successfully uninstalled extension from the profile",`${M.identifier.id}@${M.manifest.version}`,a.profileLocation.toString()):this.logService.info("Successfully uninstalled extension:",`${M.identifier.id}@${M.manifest.version}`),o(this.telemetryService,"extensionGallery:uninstall",{extensionData:(0,h.getLocalExtensionTelemetryData)(M),error:z}),this._onDidUninstallExtension.fire({identifier:M.identifier,error:z?.code,profileLocation:a.profileLocation,applicationScoped:M.isApplicationScoped})},U=[],F=[];try{U.push(u(i));const M=await this.getInstalled(1,a.profileLocation);if(a.donotIncludePack)this.logService.info("Uninstalling the extension without including packed extension",`${i.identifier.id}@${i.manifest.version}`);else{const z=this.getAllPackExtensionsToUninstall(i,M);for(const V of z)this.uninstallingExtensions.has(E(V.identifier))?this.logService.info("Extensions is already requested to uninstall",V.identifier.id):U.push(u(V))}a.donotCheckDependents?this.logService.info("Uninstalling the extension without checking dependents",`${i.identifier.id}@${i.manifest.version}`):this.checkForDependents(U.map(z=>z.extension),M,i),await this.joinAllSettled(U.map(async z=>{try{if(await z.run(),await this.joinAllSettled(this.participants.map(V=>V.postUninstall(z.extension,a,A.CancellationToken.None))),z.extension.identifier.uuid)try{await this.galleryService.reportStatistic(z.extension.manifest.publisher,z.extension.manifest.name,z.extension.manifest.version,"uninstall")}catch{}C(z.extension)}catch(V){const J=V instanceof g.ExtensionManagementError?V:new g.ExtensionManagementError((0,_.getErrorMessage)(V),g.ExtensionManagementErrorCode.Internal);throw C(z.extension,J),J}finally{F.push(z)}}))}catch(M){const z=M instanceof g.ExtensionManagementError?M:new g.ExtensionManagementError((0,_.getErrorMessage)(M),g.ExtensionManagementErrorCode.Internal);for(const V of U){try{V.cancel()}catch{}F.includes(V)||C(V.extension,z)}throw z}finally{for(const M of U)this.uninstallingExtensions.delete(E(M.extension.identifier))||this.logService.warn("Uninstallation task is not found in the cache",M.extension.identifier.id)}}checkForDependents(i,r,a){for(const E of i){const v=this.getDependents(E,r);if(v.length){const u=v.filter(C=>!i.some(U=>(0,h.areSameExtensions)(U.identifier,C.identifier)));if(u.length)throw new Error(this.getDependentsErrorMessage(E,u,a))}}}getDependentsErrorMessage(i,r,a){return a===i?r.length===1?p.localize(6,null,a.manifest.displayName||a.manifest.name,r[0].manifest.displayName||r[0].manifest.name):r.length===2?p.localize(7,null,a.manifest.displayName||a.manifest.name,r[0].manifest.displayName||r[0].manifest.name,r[1].manifest.displayName||r[1].manifest.name):p.localize(8,null,a.manifest.displayName||a.manifest.name,r[0].manifest.displayName||r[0].manifest.name,r[1].manifest.displayName||r[1].manifest.name):r.length===1?p.localize(9,null,a.manifest.displayName||a.manifest.name,i.manifest.displayName||i.manifest.name,r[0].manifest.displayName||r[0].manifest.name):r.length===2?p.localize(10,null,a.manifest.displayName||a.manifest.name,i.manifest.displayName||i.manifest.name,r[0].manifest.displayName||r[0].manifest.name,r[1].manifest.displayName||r[1].manifest.name):p.localize(11,null,a.manifest.displayName||a.manifest.name,i.manifest.displayName||i.manifest.name,r[0].manifest.displayName||r[0].manifest.name,r[1].manifest.displayName||r[1].manifest.name)}getAllPackExtensionsToUninstall(i,r,a=[]){if(a.indexOf(i)!==-1)return[];a.push(i);const E=i.manifest.extensionPack?i.manifest.extensionPack:[];if(E.length){const v=r.filter(C=>!C.isBuiltin&&E.some(U=>(0,h.areSameExtensions)({id:U},C.identifier))),u=[];for(const C of v)u.push(...this.getAllPackExtensionsToUninstall(C,r,a));return[...v,...u]}return[]}getDependents(i,r){return r.filter(a=>a.manifest.extensionDependencies&&a.manifest.extensionDependencies.some(E=>(0,h.areSameExtensions)({id:E},i.identifier)))}async updateControlCache(){try{this.logService.trace("ExtensionManagementService.refreshReportedCache");const i=await this.galleryService.getExtensionsControlManifest();return this.logService.trace("ExtensionManagementService.refreshControlCache",i),i}catch{return this.logService.trace("ExtensionManagementService.refreshControlCache - failed to get extension control manifest"),{malicious:[],deprecated:{},search:[]}}}};e.AbstractExtensionManagementService=y,e.AbstractExtensionManagementService=y=Ee([G(0,g.IExtensionGalleryService),G(1,d.ITelemetryService),G(2,c.IUriIdentityService),G(3,w.ILogService),G(4,l.IProductService),G(5,m.IUserDataProfilesService)],y);function T(s){const i=Array.isArray(s)?s:[s];return i.length===1?i[0]instanceof Error?i[0]:new Error(i[0]):i.reduce((r,a)=>new Error(`${r.message}${r.message?",":""}${a instanceof Error?a.message:a}`),new Error(""))}e.joinErrors=T;function t(s){if(s instanceof g.ExtensionManagementError)return s;const i=new g.ExtensionManagementError(s.message,g.ExtensionManagementErrorCode.Internal);return i.stack=s.stack,i}e.toExtensionManagementError=t;function o(s,i,{extensionData:r,verificationStatus:a,duration:E,error:v,durationSinceUpdate:u}){let C,U;(0,S.isDefined)(a)&&(a===!0?a="Verified":(a===!1||(C=g.ExtensionManagementErrorCode.Signature,U=a),a="Unverified")),v&&(v instanceof g.ExtensionManagementError?(C=v.code,v.code===g.ExtensionManagementErrorCode.Signature&&(U=v.message)):C=g.ExtensionManagementErrorCode.Internal),s.publicLog(i,{...r,verificationStatus:a,success:!v,duration:E,errorcode:C,errorcodeDetail:U,durationSinceUpdate:u})}class n{constructor(){this.barrier=new O.Barrier}async waitUntilTaskIsFinished(){return await this.barrier.wait(),this.cancellablePromise}async run(){return this.cancellablePromise||(this.cancellablePromise=(0,O.createCancelablePromise)(i=>this.doRun(i))),this.barrier.open(),this.cancellablePromise}cancel(){this.cancellablePromise||(this.cancellablePromise=(0,O.createCancelablePromise)(i=>new Promise((r,a)=>{const E=i.onCancellationRequested(()=>{E.dispose(),a(new _.CancellationError)})})),this.barrier.open()),this.cancellablePromise.cancel()}}e.AbstractExtensionTask=n}),define(ce[50],le([0,1,5,14,2,3,35,11,29,33,13,4,7,17,27,12,8,21]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractExtensionsProfileScannerService=e.IExtensionsProfileScannerService=e.ExtensionsProfileScanningError=e.ExtensionsProfileScanningErrorCode=void 0;var c;(function(o){o.ERROR_PROFILE_NOT_FOUND="ERROR_PROFILE_NOT_FOUND",o.ERROR_INVALID_CONTENT="ERROR_INVALID_CONTENT"})(c||(e.ExtensionsProfileScanningErrorCode=c={}));class m extends Error{constructor(n,s){super(n),this.code=s}}e.ExtensionsProfileScanningError=m,e.IExtensionsProfileScannerService=(0,p.createDecorator)("IExtensionsProfileScannerService");let y=class extends A.Disposable{constructor(n,s,i,r,a,E){super(),this.extensionsLocation=n,this.fileService=s,this.userDataProfilesService=i,this.uriIdentityService=r,this.telemetryService=a,this.logService=E,this._onAddExtensions=this._register(new _.Emitter),this.onAddExtensions=this._onAddExtensions.event,this._onDidAddExtensions=this._register(new _.Emitter),this.onDidAddExtensions=this._onDidAddExtensions.event,this._onRemoveExtensions=this._register(new _.Emitter),this.onRemoveExtensions=this._onRemoveExtensions.event,this._onDidRemoveExtensions=this._register(new _.Emitter),this.onDidRemoveExtensions=this._onDidRemoveExtensions.event,this.resourcesAccessQueueMap=new k.ResourceMap}scanProfileExtensions(n,s){return this.withProfileExtensions(n,void 0,s)}async addExtensionsToProfile(n,s){const i=[],r=[];try{return await this.withProfileExtensions(s,a=>{const E=[];for(const v of a)n.some(([u])=>(0,S.areSameExtensions)(u.identifier,v.identifier)&&u.manifest.version!==v.version)?i.push(v):E.push(v);for(const[v,u]of n){const C=E.findIndex(F=>(0,S.areSameExtensions)(F.identifier,v.identifier)&&F.version===v.manifest.version),U={identifier:v.identifier,version:v.manifest.version,location:v.location,metadata:u};C===-1?(r.push(U),E.push(U)):E.splice(C,1,U)}return r.length&&this._onAddExtensions.fire({extensions:r,profileLocation:s}),i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:s}),E}),r.length&&this._onDidAddExtensions.fire({extensions:r,profileLocation:s}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:s}),r}catch(a){throw r.length&&this._onDidAddExtensions.fire({extensions:r,error:a,profileLocation:s}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:a,profileLocation:s}),a}}async updateMetadata(n,s){const i=[];return await this.withProfileExtensions(s,r=>{const a=[];for(const E of r){const v=n.find(([u])=>(0,S.areSameExtensions)(u.identifier,E.identifier)&&u.manifest.version===E.version);v&&(E.metadata={...E.metadata,...v[1]},i.push(E)),a.push(E)}return a}),i}async removeExtensionFromProfile(n,s){const i=[];try{await this.withProfileExtensions(s,r=>{const a=[];for(const E of r)(0,S.areSameExtensions)(E.identifier,n.identifier)?i.push(E):a.push(E);return i.length&&this._onRemoveExtensions.fire({extensions:i,profileLocation:s}),a}),i.length&&this._onDidRemoveExtensions.fire({extensions:i,profileLocation:s})}catch(r){throw i.length&&this._onDidRemoveExtensions.fire({extensions:i,error:r,profileLocation:s}),r}}async withProfileExtensions(n,s,i){return this.getResourceAccessQueue(n).queue(async()=>{let r=[],a;try{const E=await this.fileService.readFile(n);a=JSON.parse(E.value.toString().trim()||"[]")}catch(E){if((0,P.toFileOperationResult)(E)!==1)throw E;if(this.uriIdentityService.extUri.isEqual(n,this.userDataProfilesService.defaultProfile.extensionsResource)&&(a=await this.migrateFromOldDefaultProfileExtensionsLocation()),!a&&i?.bailOutWhenFileNotFound)throw new m((0,l.getErrorMessage)(E),"ERROR_PROFILE_NOT_FOUND")}if(a){Array.isArray(a)||this.reportAndThrowInvalidConentError(n);let E=!1;for(const v of a){T(v)||this.reportAndThrowInvalidConentError(n);let u;if((0,w.isString)(v.relativeLocation)&&v.relativeLocation)u=this.resolveExtensionLocation(v.relativeLocation);else if((0,w.isString)(v.location))u=this.resolveExtensionLocation(v.location),E=!0,v.relativeLocation=v.location,v.location=u.toJSON();else{u=D.URI.revive(v.location);const C=this.toRelativePath(u);C&&(E=!0,v.relativeLocation=C)}r.push({identifier:v.identifier,location:u,version:v.version,metadata:v.metadata})}E&&await this.fileService.writeFile(n,O.VSBuffer.fromString(JSON.stringify(a)))}if(s){r=s(r);const E=r.map(v=>({identifier:v.identifier,version:v.version,location:v.location.toJSON(),relativeLocation:this.toRelativePath(v.location),metadata:v.metadata}));await this.fileService.writeFile(n,O.VSBuffer.fromString(JSON.stringify(E)))}return r})}reportAndThrowInvalidConentError(n){const s=new m(`Invalid extensions content in ${n.toString()}`,"ERROR_INVALID_CONTENT");throw this.telemetryService.publicLogError2("extensionsProfileScanningError",{code:s.code}),s}toRelativePath(n){return this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(n),this.extensionsLocation)?this.uriIdentityService.extUri.basename(n):void 0}resolveExtensionLocation(n){return this.uriIdentityService.extUri.joinPath(this.extensionsLocation,n)}async migrateFromOldDefaultProfileExtensionsLocation(){return this._migrationPromise||(this._migrationPromise=(async()=>{const n=this.uriIdentityService.extUri.joinPath(this.userDataProfilesService.defaultProfile.location,"extensions.json"),s=this.uriIdentityService.extUri.joinPath(this.extensionsLocation,".init-default-profile-extensions");let i;try{i=(await this.fileService.readFile(n)).value.toString()}catch(a){if((0,P.toFileOperationResult)(a)===1)return;throw a}this.logService.info("Migrating extensions from old default profile location",n.toString());let r;try{const a=JSON.parse(i);Array.isArray(a)&&a.every(E=>T(E))?r=a:this.logService.warn("Skipping migrating from old default profile locaiton: Found invalid data",a)}catch(a){this.logService.error(a)}if(r)try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,O.VSBuffer.fromString(JSON.stringify(r)),{overwrite:!1}),this.logService.info("Migrated extensions from old default profile location to new location",n.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString())}catch(a){if((0,P.toFileOperationResult)(a)===3)this.logService.info("Migration from old default profile location to new location is done by another window",n.toString(),this.userDataProfilesService.defaultProfile.extensionsResource.toString());else throw a}try{await this.fileService.del(n)}catch(a){(0,P.toFileOperationResult)(a)!==1&&this.logService.error(a)}try{await this.fileService.del(s)}catch(a){(0,P.toFileOperationResult)(a)!==1&&this.logService.error(a)}return r})()),this._migrationPromise}getResourceAccessQueue(n){let s=this.resourcesAccessQueueMap.get(n);return s||(s=new I.Queue,this.resourcesAccessQueueMap.set(n,s)),s}};e.AbstractExtensionsProfileScannerService=y,e.AbstractExtensionsProfileScannerService=y=Ee([G(1,P.IFileService),G(2,h.IUserDataProfilesService),G(3,f.IUriIdentityService),G(4,d.ITelemetryService),G(5,g.ILogService)],y);function T(o){return(0,w.isObject)(o)&&(0,b.isIExtensionIdentifier)(o.identifier)&&(t(o.location)||(0,w.isString)(o.location)&&o.location)&&((0,w.isUndefined)(o.relativeLocation)||(0,w.isString)(o.relativeLocation))&&o.version&&(0,w.isString)(o.version)}function t(o){return o?(0,w.isString)(o.path)&&(0,w.isString)(o.scheme):!1}}),define(ce[79],le([0,1,20,5,30,14,8,34,139,2,26,16,6,22,53,90,12,11,155,15,33,41,66,13,4,7,23,3,62,50,17,27,183]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o,n,s,i,r,a,E,v,u,C){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeExtensionsScannerService=e.toExtensionDescription=e.ExtensionScannerInput=e.AbstractExtensionsScannerService=e.IExtensionsScannerService=e.Translations=void 0;var U;(function(Y){function B(K,x){if(K===x)return!0;const q=Object.keys(K),j=new Set;for(const Z of Object.keys(x))j.add(Z);if(q.length!==j.size)return!1;for(const Z of q){if(K[Z]!==x[Z])return!1;j.delete(Z)}return j.size===0}Y.equals=B})(U||(e.Translations=U={})),e.IExtensionsScannerService=(0,n.createDecorator)("IExtensionsScannerService");let F=class extends S.Disposable{constructor(B,K,x,q,j,Z,oe,ue,ae,$,R,L){super(),this.systemExtensionsLocation=B,this.userExtensionsLocation=K,this.extensionsControlLocation=x,this.currentProfile=q,this.userDataProfilesService=j,this.extensionsProfileScannerService=Z,this.fileService=oe,this.logService=ue,this.environmentService=ae,this.productService=$,this.uriIdentityService=R,this.instantiationService=L,this._onDidChangeCache=this._register(new r.Emitter),this.onDidChangeCache=this._onDidChangeCache.event,this.obsoleteFile=(0,h.joinPath)(this.userExtensionsLocation,".obsolete"),this.systemExtensionsCachedScanner=this._register(this.instantiationService.createInstance(V,this.currentProfile,this.obsoleteFile)),this.userExtensionsCachedScanner=this._register(this.instantiationService.createInstance(V,this.currentProfile,this.obsoleteFile)),this.extensionsScanner=this._register(this.instantiationService.createInstance(z,this.obsoleteFile)),this.initializeDefaultProfileExtensionsPromise=void 0,this._register(this.systemExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(0))),this._register(this.userExtensionsCachedScanner.onDidChangeCache(()=>this._onDidChangeCache.fire(1)))}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=(0,y.computeTargetPlatform)(this.fileService,this.logService)),this._targetPlatformPromise}async scanAllExtensions(B,K,x){const[q,j]=await Promise.all([this.scanSystemExtensions(B),this.scanUserExtensions(K)]),Z=x?await this.scanExtensionsUnderDevelopment(B,[...q,...j]):[];return this.dedupExtensions(q,j,Z,await this.getTargetPlatform(),!0)}async scanSystemExtensions(B){const K=[];K.push(this.scanDefaultSystemExtensions(!!B.useCache,B.language)),K.push(this.scanDevSystemExtensions(B.language,!!B.checkControlFile));const[x,q]=await Promise.all(K);return this.applyScanOptions([...x,...q],0,B,!1)}async scanUserExtensions(B){const K=B.profileLocation??this.userExtensionsLocation;this.logService.trace("Started scanning user extensions",K);const x=this.uriIdentityService.extUri.isEqual(B.profileLocation,this.userDataProfilesService.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,q=await this.createExtensionScannerInput(K,!!B.profileLocation,1,!B.includeUninstalled,B.language,!0,x),j=B.useCache&&!q.devMode&&q.excludeObsolete?this.userExtensionsCachedScanner:this.extensionsScanner;let Z;try{Z=await j.scanExtensions(q)}catch(oe){if(oe instanceof E.ExtensionsProfileScanningError&&oe.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions(),Z=await j.scanExtensions(q);else throw oe}return Z=await this.applyScanOptions(Z,1,B,!0),this.logService.trace("Scanned user extensions:",Z.length),Z}async scanExtensionsUnderDevelopment(B,K){if(this.environmentService.isExtensionDevelopment&&this.environmentService.extensionDevelopmentLocationURI){const x=(await Promise.all(this.environmentService.extensionDevelopmentLocationURI.filter(q=>q.scheme===P.Schemas.file).map(async q=>{const j=await this.createExtensionScannerInput(q,!1,1,!0,B.language,!1,void 0);return(await this.extensionsScanner.scanOneOrMultipleExtensions(j)).map(oe=>(oe.type=K.find(ue=>(0,y.areSameExtensions)(ue.identifier,oe.identifier))?.type??oe.type,this.extensionsScanner.validate(oe,j)))}))).flat();return this.applyScanOptions(x,"development",B,!0)}return[]}async scanExistingExtension(B,K,x){const q=await this.createExtensionScannerInput(B,!1,K,!0,x.language,!0,void 0),j=await this.extensionsScanner.scanExtension(q);return!j||!x.includeInvalid&&!j.isValid?null:j}async scanOneOrMultipleExtensions(B,K,x){const q=await this.createExtensionScannerInput(B,!1,K,!0,x.language,!0,void 0),j=await this.extensionsScanner.scanOneOrMultipleExtensions(q);return this.applyScanOptions(j,K,x,!0)}async scanMetadata(B){const K=(0,h.joinPath)(B,"package.json"),x=(await this.fileService.readFile(K)).value.toString();return JSON.parse(x).__metadata}async updateMetadata(B,K){const x=(0,h.joinPath)(B,"package.json"),q=(await this.fileService.readFile(x)).value.toString(),j=JSON.parse(q);K.isMachineScoped=K.isMachineScoped||void 0,K.isBuiltin=K.isBuiltin||void 0,j.__metadata={...j.__metadata,...K},await this.fileService.writeFile((0,h.joinPath)(B,"package.json"),_.VSBuffer.fromString(JSON.stringify(j,null,"	")))}async initializeDefaultProfileExtensions(){try{await this.extensionsProfileScannerService.scanProfileExtensions(this.userDataProfilesService.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(B){if(B instanceof E.ExtensionsProfileScanningError&&B.code==="ERROR_PROFILE_NOT_FOUND")await this.doInitializeDefaultProfileExtensions();else throw B}}async doInitializeDefaultProfileExtensions(){return this.initializeDefaultProfileExtensionsPromise||(this.initializeDefaultProfileExtensionsPromise=(async()=>{try{this.logService.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const B=await this.scanUserExtensions({includeInvalid:!0});if(B.length)await this.extensionsProfileScannerService.addExtensionsToProfile(B.map(K=>[K,K.metadata]),this.userDataProfilesService.defaultProfile.extensionsResource);else try{await this.fileService.createFile(this.userDataProfilesService.defaultProfile.extensionsResource,_.VSBuffer.fromString(JSON.stringify([])))}catch(K){(0,o.toFileOperationResult)(K)!==1&&this.logService.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),(0,k.getErrorMessage)(K))}this.logService.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(B){this.logService.error(B)}finally{this.initializeDefaultProfileExtensionsPromise=void 0}})()),this.initializeDefaultProfileExtensionsPromise}async applyScanOptions(B,K,x,q){return x.includeAllVersions||(B=this.dedupExtensions(K===0?B:void 0,K===1?B:void 0,K==="development"?B:void 0,await this.getTargetPlatform(),q)),x.includeInvalid||(B=B.filter(j=>j.isValid)),B.sort((j,Z)=>{const oe=p.basename(j.location.fsPath),ue=p.basename(Z.location.fsPath);return oe<ue?-1:oe>ue?1:0})}dedupExtensions(B,K,x,q,j){const Z=(ue,ae,$)=>{if(ue.isValid&&!ae.isValid)return!1;if(ue.isValid===ae.isValid){if(j&&f.gt(ue.manifest.version,ae.manifest.version))return this.logService.debug(`Skipping extension ${ae.location.path} with lower version ${ae.manifest.version} in favour of ${ue.location.path} with version ${ue.manifest.version}`),!1;if(f.eq(ue.manifest.version,ae.manifest.version)){if(ue.type===0)return this.logService.debug(`Skipping extension ${ae.location.path} in favour of system extension ${ue.location.path} with same version`),!1;if(ue.targetPlatform===q)return this.logService.debug(`Skipping extension ${ae.location.path} from different target platform ${ae.targetPlatform}`),!1}}return $?this.logService.warn(`Overwriting user extension ${ue.location.path} with ${ae.location.path}.`):this.logService.debug(`Overwriting user extension ${ue.location.path} with ${ae.location.path}.`),!0},oe=new T.ExtensionIdentifierMap;return B?.forEach(ue=>{const ae=oe.get(ue.identifier.id);(!ae||Z(ae,ue,!1))&&oe.set(ue.identifier.id,ue)}),K?.forEach(ue=>{const ae=oe.get(ue.identifier.id);if(!ae&&B&&ue.type===0){this.logService.debug(`Skipping obsolete system extension ${ue.location.path}.`);return}(!ae||Z(ae,ue,!1))&&oe.set(ue.identifier.id,ue)}),x?.forEach(ue=>{const ae=oe.get(ue.identifier.id);(!ae||Z(ae,ue,!0))&&oe.set(ue.identifier.id,ue),oe.set(ue.identifier.id,ue)}),[...oe.values()]}async scanDefaultSystemExtensions(B,K){this.logService.trace("Started scanning system extensions");const x=await this.createExtensionScannerInput(this.systemExtensionsLocation,!1,0,!0,K,!0,void 0),j=await(B&&!x.devMode?this.systemExtensionsCachedScanner:this.extensionsScanner).scanExtensions(x);return this.logService.trace("Scanned system extensions:",j.length),j}async scanDevSystemExtensions(B,K){const x=this.environmentService.isBuilt?[]:this.productService.builtInExtensions;if(!x?.length)return[];this.logService.trace("Started scanning dev system extensions");const q=K?await this.getBuiltInExtensionControl():{},j=[],Z=d.URI.file(p.normalize(p.join(P.FileAccess.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const ue of x){const ae=q[ue.name]||"marketplace";switch(ae){case"disabled":break;case"marketplace":j.push((0,h.joinPath)(Z,ue.name));break;default:j.push(d.URI.file(ae));break}}const oe=await Promise.all(j.map(async ue=>this.extensionsScanner.scanExtension(await this.createExtensionScannerInput(ue,!1,0,!0,B,!0,void 0))));return this.logService.trace("Scanned dev system extensions:",oe.length),(0,I.coalesce)(oe)}async getBuiltInExtensionControl(){try{const B=await this.fileService.readFile(this.extensionsControlLocation);return JSON.parse(B.value.toString())}catch{return{}}}async createExtensionScannerInput(B,K,x,q,j,Z,oe){const ue=await this.getTranslations(j??g.language),ae=await this.getMtime(B),$=K&&!this.uriIdentityService.extUri.isEqual(B,this.userDataProfilesService.defaultProfile.extensionsResource)?this.userDataProfilesService.defaultProfile.extensionsResource:void 0,R=$?await this.getMtime($):void 0;return new M(B,ae,$,R,K,oe,x,q,Z,this.productService.version,this.productService.vscodeVersion,this.productService.date,this.productService.commit,!this.environmentService.isBuilt,j,ue)}async getMtime(B){try{const K=await this.fileService.stat(B);if(typeof K.mtime=="number")return K.mtime}catch{}}};e.AbstractExtensionsScannerService=F,e.AbstractExtensionsScannerService=F=Ee([G(4,v.IUserDataProfilesService),G(5,E.IExtensionsProfileScannerService),G(6,o.IFileService),G(7,s.ILogService),G(8,m.IEnvironmentService),G(9,i.IProductService),G(10,u.IUriIdentityService),G(11,n.IInstantiationService)],F);class M{constructor(B,K,x,q,j,Z,oe,ue,ae,$,R,L,N,W,X,ne){this.location=B,this.mtime=K,this.applicationExtensionslocation=x,this.applicationExtensionslocationMtime=q,this.profile=j,this.profileScanOptions=Z,this.type=oe,this.excludeObsolete=ue,this.validate=ae,this.productVersion=$,this.vsCodeProductVersion=R,this.productDate=L,this.productCommit=N,this.devMode=W,this.language=X,this.translations=ne}static createNlsConfiguration(B){return{language:B.language,pseudo:B.language==="pseudo",devMode:B.devMode,translations:B.translations}}static equals(B,K){return(0,h.isEqual)(B.location,K.location)&&B.mtime===K.mtime&&(0,h.isEqual)(B.applicationExtensionslocation,K.applicationExtensionslocation)&&B.applicationExtensionslocationMtime===K.applicationExtensionslocationMtime&&B.profile===K.profile&&A.equals(B.profileScanOptions,K.profileScanOptions)&&B.type===K.type&&B.excludeObsolete===K.excludeObsolete&&B.validate===K.validate&&B.productVersion===K.productVersion&&B.productDate===K.productDate&&B.productCommit===K.productCommit&&B.devMode===K.devMode&&B.language===K.language&&U.equals(B.translations,K.translations)}}e.ExtensionScannerInput=M;let z=class extends S.Disposable{constructor(B,K,x,q,j){super(),this.obsoleteFile=B,this.extensionsProfileScannerService=K,this.uriIdentityService=x,this.fileService=q,this.logService=j}async scanExtensions(B){const K=B.profile?await this.scanExtensionsFromProfile(B):await this.scanExtensionsFromLocation(B);let x={};if(B.excludeObsolete&&B.type===1)try{const q=(await this.fileService.readFile(this.obsoleteFile)).value.toString();x=JSON.parse(q)}catch{}return(0,l.isEmptyObject)(x)?K:K.filter(q=>!x[y.ExtensionKey.create(q).toString()])}async scanExtensionsFromLocation(B){const K=await this.fileService.resolve(B.location);if(!K.children?.length)return[];const x=await Promise.all(K.children.map(async q=>{if(!q.isDirectory||B.type===1&&(0,h.basename)(q.resource).indexOf(".")===0)return null;const j=new M(q.resource,B.mtime,B.applicationExtensionslocation,B.applicationExtensionslocationMtime,B.profile,B.profileScanOptions,B.type,B.excludeObsolete,B.validate,B.productVersion,B.vsCodeProductVersion,B.productDate,B.productCommit,B.devMode,B.language,B.translations);return this.scanExtension(j)}));return(0,I.coalesce)(x).sort((q,j)=>q.location.path<j.location.path?-1:1)}async scanExtensionsFromProfile(B){let K=await this.scanExtensionsFromProfileResource(B.location,()=>!0,B);if(B.applicationExtensionslocation&&!this.uriIdentityService.extUri.isEqual(B.location,B.applicationExtensionslocation)){K=K.filter(q=>!q.metadata?.isApplicationScoped);const x=await this.scanExtensionsFromProfileResource(B.applicationExtensionslocation,q=>!!q.metadata?.isBuiltin||!!q.metadata?.isApplicationScoped,B);K.push(...x)}return K}async scanExtensionsFromProfileResource(B,K,x){const q=await this.extensionsProfileScannerService.scanProfileExtensions(B,x.profileScanOptions);if(!q.length)return[];const j=await Promise.all(q.map(async Z=>{if(K(Z)){const oe=new M(Z.location,x.mtime,x.applicationExtensionslocation,x.applicationExtensionslocationMtime,x.profile,x.profileScanOptions,x.type,x.excludeObsolete,x.validate,x.productVersion,x.vsCodeProductVersion,x.productDate,x.productCommit,x.devMode,x.language,x.translations);return this.scanExtension(oe,Z.metadata)}return null}));return(0,I.coalesce)(j)}async scanOneOrMultipleExtensions(B){try{if(await this.fileService.exists((0,h.joinPath)(B.location,"package.json"))){const K=await this.scanExtension(B);return K?[K]:[]}else return await this.scanExtensions(B)}catch(K){return this.logService.error(`Error scanning extensions at ${B.location.path}:`,(0,k.getErrorMessage)(K)),[]}}async scanExtension(B,K){try{let x=await this.scanExtensionManifest(B.location);if(x){x.publisher||(x.publisher=T.UNDEFINED_PUBLISHER),K=K??x.__metadata,delete x.__metadata;const q=(0,y.getGalleryExtensionId)(x.publisher,x.name),j=K?.id?{id:q,uuid:K.id}:{id:q},Z=K?.isSystem?0:B.type,oe=Z===0||!!K?.isBuiltin;x=await this.translateManifest(B.location,x,M.createNlsConfiguration(B));const ue={type:Z,identifier:j,manifest:x,location:B.location,isBuiltin:oe,targetPlatform:K?.targetPlatform??"undefined",metadata:K,isValid:!0,validations:[]};return B.validate?this.validate(ue,B):ue}}catch(x){B.type!==0&&this.logService.error(x)}return null}validate(B,K){let x=!0;const q=(0,t.validateExtensionManifest)(K.productVersion,K.vsCodeProductVersion,K.productDate,K.location,B.manifest,B.isBuiltin);for(const[j,Z]of q)j===w.default.Error&&(x=!1,this.logService.error(this.formatMessage(K.location,Z)));return B.isValid=x,B.validations=q,B}async scanExtensionManifest(B){const K=(0,h.joinPath)(B,"package.json");let x;try{x=(await this.fileService.readFile(K)).value.toString()}catch(j){return(0,o.toFileOperationResult)(j)!==1&&this.logService.error(this.formatMessage(B,(0,c.localize)(0,null,K.path,j.message))),null}let q;try{q=JSON.parse(x)}catch{const Z=[];(0,D.parse)(x,Z);for(const oe of Z)this.logService.error(this.formatMessage(B,(0,c.localize)(1,null,K.path,oe.offset,oe.length,(0,b.getParseErrorMessage)(oe.error))));return null}return(0,D.getNodeType)(q)!=="object"?(this.logService.error(this.formatMessage(B,(0,c.localize)(2,null,K.path))),null):q}async translateManifest(B,K,x){const q=await this.getLocalizedMessages(B,K,x);if(q)try{const j=[],Z=await this.resolveOriginalMessageBundle(q.default,j);if(j.length>0)return j.forEach(ue=>{this.logService.error(this.formatMessage(B,(0,c.localize)(3,null,q.default?.path,(0,b.getParseErrorMessage)(ue.error))))}),K;if((0,D.getNodeType)(q)!=="object")return this.logService.error(this.formatMessage(B,(0,c.localize)(4,null,q.default?.path))),K;const oe=q.values||Object.create(null);return(0,C.localizeManifest)(K,oe,Z)}catch{}return K}async getLocalizedMessages(B,K,x){const q=(0,h.joinPath)(B,"package.nls.json"),j=(ae,$)=>{$.forEach(R=>{this.logService.error(this.formatMessage(B,(0,c.localize)(5,null,ae?.path,(0,b.getParseErrorMessage)(R.error))))})},Z=ae=>{this.logService.error(this.formatMessage(B,(0,c.localize)(6,null,ae?.path)))},oe=`${K.publisher}.${K.name}`,ue=x.translations[oe];if(ue)try{const ae=d.URI.file(ue),$=(await this.fileService.readFile(ae)).value.toString(),R=[],L=(0,D.parse)($,R);return R.length>0?(j(ae,R),{values:void 0,default:q}):(0,D.getNodeType)(L)!=="object"?(Z(ae),{values:void 0,default:q}):{values:L.contents?L.contents.package:void 0,default:q}}catch{return{values:void 0,default:q}}else{if(!await this.fileService.exists(q))return;let $;try{$=await this.findMessageBundles(B,x)}catch{return}if(!$.localized)return{values:void 0,default:$.original};try{const R=(await this.fileService.readFile($.localized)).value.toString(),L=[],N=(0,D.parse)(R,L);return L.length>0?(j($.localized,L),{values:void 0,default:$.original}):(0,D.getNodeType)(N)!=="object"?(Z($.localized),{values:void 0,default:$.original}):{values:N,default:$.original}}catch{return{values:void 0,default:$.original}}}}async resolveOriginalMessageBundle(B,K){if(B)try{const x=(await this.fileService.readFile(B)).value.toString();return(0,D.parse)(x,K)}catch{}}findMessageBundles(B,K){return new Promise((x,q)=>{const j=Z=>{const oe=(0,h.joinPath)(B,`package.nls.${Z}.json`);this.fileService.exists(oe).then(ue=>{ue&&x({localized:oe,original:(0,h.joinPath)(B,"package.nls.json")});const ae=Z.lastIndexOf("-");ae===-1?x({localized:(0,h.joinPath)(B,"package.nls.json"),original:null}):(Z=Z.substring(0,ae),j(Z))})};if(K.devMode||K.pseudo||!K.language)return x({localized:(0,h.joinPath)(B,"package.nls.json"),original:null});j(K.language)})}formatMessage(B,K){return`[${B.path}]: ${K}`}};z=Ee([G(1,E.IExtensionsProfileScannerService),G(2,u.IUriIdentityService),G(3,o.IFileService),G(4,s.ILogService)],z);let V=class extends z{constructor(B,K,x,q,j,Z,oe){super(K,q,j,Z,oe),this.currentProfile=B,this.userDataProfilesService=x,this.cacheValidatorThrottler=this._register(new O.ThrottledDelayer(3e3)),this._onDidChangeCache=this._register(new r.Emitter),this.onDidChangeCache=this._onDidChangeCache.event}async scanExtensions(B){const K=this.getCacheFile(B),x=await this.readExtensionCache(K);if(this.input=B,x&&x.input&&M.equals(x.input,this.input))return this.logService.debug("Using cached extensions scan result",B.location.toString()),this.cacheValidatorThrottler.trigger(()=>this.validateCache()),x.result.map(j=>(j.location=d.URI.revive(j.location),j));const q=await super.scanExtensions(B);return await this.writeExtensionCache(K,{input:B,result:q}),q}async readExtensionCache(B){try{const K=await this.fileService.readFile(B),x=JSON.parse(K.value.toString());return{result:x.result,input:(0,a.revive)(x.input)}}catch(K){this.logService.debug("Error while reading the extension cache file:",B.path,(0,k.getErrorMessage)(K))}return null}async writeExtensionCache(B,K){try{await this.fileService.writeFile(B,_.VSBuffer.fromString(JSON.stringify(K)))}catch(x){this.logService.debug("Error while writing the extension cache file:",B.path,(0,k.getErrorMessage)(x))}}async validateCache(){if(!this.input)return;const B=this.getCacheFile(this.input),K=await this.readExtensionCache(B);if(!K)return;const x=K.result,q=JSON.parse(JSON.stringify(await super.scanExtensions(this.input)));if(!A.equals(q,x))try{this.logService.info("Invalidating Cache",x,q),await this.fileService.del(B),this._onDidChangeCache.fire()}catch(j){this.logService.error(j)}}getCacheFile(B){const K=this.getProfile(B);return this.uriIdentityService.extUri.joinPath(K.cacheHome,B.type===0?T.BUILTIN_MANIFEST_CACHE_FILE:T.USER_MANIFEST_CACHE_FILE)}getProfile(B){return B.type===0?this.userDataProfilesService.defaultProfile:B.profile?this.uriIdentityService.extUri.isEqual(B.location,this.currentProfile.extensionsResource)?this.currentProfile:this.userDataProfilesService.profiles.find(K=>this.uriIdentityService.extUri.isEqual(B.location,K.extensionsResource))??this.currentProfile:this.userDataProfilesService.defaultProfile}};V=Ee([G(2,v.IUserDataProfilesService),G(3,E.IExtensionsProfileScannerService),G(4,u.IUriIdentityService),G(5,o.IFileService),G(6,s.ILogService)],V);function J(Y,B){const K=(0,y.getExtensionId)(Y.manifest.publisher,Y.manifest.name);return{id:K,identifier:new T.ExtensionIdentifier(K),isBuiltin:Y.type===0,isUserBuiltin:Y.type===1&&Y.isBuiltin,isUnderDevelopment:B,extensionLocation:Y.location,uuid:Y.identifier.uuid,targetPlatform:Y.targetPlatform,...Y.manifest}}e.toExtensionDescription=J;class H extends F{constructor(B,K,x,q,j,Z,oe,ue,ae,$,R,L){super(B,K,(0,h.joinPath)(x,".vscode-oss-dev","extensions","control.json"),q,j,Z,oe,ue,ae,$,R,L),this.translationsPromise=(async()=>{if(g.translationsConfigFile)try{const N=await this.fileService.readFile(d.URI.file(g.translationsConfigFile));return JSON.parse(N.value.toString())}catch{}return Object.create(null)})()}getTranslations(B){return this.translationsPromise}}e.NativeExtensionsScannerService=H}),define(ce[244],le([0,1,63,5,38,3,2,26,16,31,7,17]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsLifecycle=void 0;let g=class extends k.Disposable{constructor(f,w){super(),this.userDataProfilesService=f,this.logService=w,this.processesLimiter=new O.Limiter(5)}async postUninstall(f){const w=this.parseScript(f,"uninstall");w&&(this.logService.info(f.identifier.id,f.manifest.version,"Running post uninstall script"),await this.processesLimiter.queue(async()=>{try{await this.runLifecycleHook(w.script,"uninstall",w.args,!0,f),this.logService.info("Finished running post uninstall script",f.identifier.id,f.manifest.version)}catch(l){this.logService.error("Failed to run post uninstall script",f.identifier.id,f.manifest.version),this.logService.error(l)}}));try{await S.Promises.rm(this.getExtensionStoragePath(f))}catch(l){this.logService.error("Error while removing extension storage path",f.identifier.id),this.logService.error(l)}}parseScript(f,w){const l=`vscode:${w}`;if(f.location.scheme===D.Schemas.file&&f.manifest&&f.manifest.scripts&&typeof f.manifest.scripts[l]=="string"){const d=f.manifest.scripts[l].split(" ");return d.length<2||d[0]!=="node"||!d[1]?(this.logService.warn(f.identifier.id,f.manifest.version,`${l} should be a node script`),null):{script:(0,b.join)(f.location.fsPath,d[1]),args:d.slice(2)||[]}}return null}runLifecycleHook(f,w,l,d,c){return new Promise((m,y)=>{const T=this.start(f,w,l,c);let t;const o=n=>{t&&(clearTimeout(t),t=null),n?y(n):m(void 0)};T.on("error",n=>{o((0,A.toErrorMessage)(n)||"Unknown")}),T.on("exit",(n,s)=>{o(n?`post-${w} process exited with code ${n}`:void 0)}),d&&(t=setTimeout(()=>{t=null,T.kill(),y("timed out")},5e3))})}start(f,w,l,d){const c={silent:!0,execArgv:void 0},m=(0,I.fork)(f,[`--type=extension-post-${w}`,...l],c);m.stdout.setEncoding("utf8"),m.stderr.setEncoding("utf8");const y=_.Event.fromNodeEventEmitter(m.stdout,"data"),T=_.Event.fromNodeEventEmitter(m.stderr,"data");y(n=>this.logService.info(d.identifier.id,d.manifest.version,`post-${w}`,n)),T(n=>this.logService.error(d.identifier.id,d.manifest.version,`post-${w}`,n));const t=_.Event.any(_.Event.map(y,n=>({data:`%c${n}`,format:[""]})),_.Event.map(T,n=>({data:`%c${n}`,format:["color: red"]})));return _.Event.debounce(t,(n,s)=>n?{data:n.data+s.data,format:[...n.format,...s.format]}:{data:s.data,format:s.format},100)(n=>{console.group(d.identifier.id),console.log(n.data,...n.format),console.groupEnd()}),m}getExtensionStoragePath(f){return(0,b.join)(this.userDataProfilesService.defaultProfile.globalStorageHome.fsPath,f.identifier.id.toLowerCase())}};e.ExtensionsLifecycle=g,e.ExtensionsLifecycle=g=Ee([G(0,p.IUserDataProfilesService),G(1,P.ILogService)],g)}),define(ce[245],le([0,1,7,17,27,21,50,13,15,11]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsProfileScannerService=void 0;let P=class extends k.AbstractExtensionsProfileScannerService{constructor(g,h,f,w,l,d){super(S.URI.file(g.extensionsPath),h,f,w,l,d)}};e.ExtensionsProfileScannerService=P,e.ExtensionsProfileScannerService=P=Ee([G(0,b.INativeEnvironmentService),G(1,D.IFileService),G(2,O.IUserDataProfilesService),G(3,A.IUriIdentityService),G(4,_.ITelemetryService),G(5,I.ILogService)],P)}),define(ce[246],le([0,1,11,15,50,79,13,4,7,23,27,17]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsScannerService=void 0;let g=class extends _.NativeExtensionsScannerService{constructor(f,w,l,d,c,m,y,T){super(I.URI.file(c.builtinExtensionsPath),I.URI.file(c.extensionsPath),c.userHome,f.defaultProfile,f,w,l,d,c,m,y,T)}};e.ExtensionsScannerService=g,e.ExtensionsScannerService=g=Ee([G(0,p.IUserDataProfilesService),G(1,A.IExtensionsProfileScannerService),G(2,k.IFileService),G(3,b.ILogService),G(4,O.INativeEnvironmentService),G(5,S.IProductService),G(6,P.IUriIdentityService),G(7,D.IInstantiationService)],g)}),define(ce[19],le([0,1,5,3,2,102,12,65,4,17]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.logStorage=e.InMemoryStorageService=e.isProfileUsingDefaultStorage=e.AbstractStorageService=e.loadKeyTargets=e.StorageTarget=e.StorageScope=e.WillSaveStateReason=e.IStorageService=e.TARGET_KEY=e.IS_NEW_KEY=void 0,e.IS_NEW_KEY="__$__isNewStorageMarker",e.TARGET_KEY="__$__targetStorageMarker",e.IStorageService=(0,b.createDecorator)("storageService");var P;(function(c){c[c.NONE=0]="NONE",c[c.SHUTDOWN=1]="SHUTDOWN"})(P||(e.WillSaveStateReason=P={}));var p;(function(c){c[c.APPLICATION=-1]="APPLICATION",c[c.PROFILE=0]="PROFILE",c[c.WORKSPACE=1]="WORKSPACE"})(p||(e.StorageScope=p={}));var g;(function(c){c[c.USER=0]="USER",c[c.MACHINE=1]="MACHINE"})(g||(e.StorageTarget=g={}));function h(c){const m=c.get(e.TARGET_KEY);if(m)try{return JSON.parse(m)}catch{}return Object.create(null)}e.loadKeyTargets=h;class f extends A.Disposable{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(m={flushInterval:f.DEFAULT_FLUSH_INTERVAL}){super(),this.options=m,this._onDidChangeValue=this._register(new O.PauseableEmitter),this._onDidChangeTarget=this._register(new O.PauseableEmitter),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new O.Emitter),this.onWillSaveState=this._onWillSaveState.event,this.flushWhenIdleScheduler=this._register(new I.RunOnceScheduler(()=>this.doFlushWhenIdle(),this.options.flushInterval)),this.runFlushWhenIdle=this._register(new A.MutableDisposable),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(m,y,T){return O.Event.filter(this._onDidChangeValue.event,t=>t.scope===m&&(y===void 0||t.key===y),T)}doFlushWhenIdle(){this.runFlushWhenIdle.value=(0,I.runWhenIdle)(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){(0,A.dispose)([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{(0,_.mark)("code/willInitStorage");try{await this.doInitialize()}finally{(0,_.mark)("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(m,y){const{key:T,external:t}=y;if(T===e.TARGET_KEY){switch(m){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:m})}else this._onDidChangeValue.fire({scope:m,key:T,target:this.getKeyTargets(m)[T],external:t})}emitWillSaveState(m){this._onWillSaveState.fire({reason:m})}get(m,y,T){return this.getStorage(y)?.get(m,T)}getBoolean(m,y,T){return this.getStorage(y)?.getBoolean(m,T)}getNumber(m,y,T){return this.getStorage(y)?.getNumber(m,T)}getObject(m,y,T){return this.getStorage(y)?.getObject(m,T)}storeAll(m,y){this.withPausedEmitters(()=>{for(const T of m)this.store(T.key,T.value,T.scope,T.target,y)})}store(m,y,T,t,o=!1){if((0,k.isUndefinedOrNull)(y)){this.remove(m,T,o);return}this.withPausedEmitters(()=>{this.updateKeyTarget(m,T,t),this.getStorage(T)?.set(m,y,o)})}remove(m,y,T=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(m,y,void 0),this.getStorage(y)?.delete(m,T)})}withPausedEmitters(m){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{m()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(m,y){const T=[],t=this.getKeyTargets(m);for(const o of Object.keys(t))t[o]===y&&T.push(o);return T}updateKeyTarget(m,y,T,t=!1){const o=this.getKeyTargets(y);typeof T=="number"?o[m]!==T&&(o[m]=T,this.getStorage(y)?.set(e.TARGET_KEY,JSON.stringify(o),t)):typeof o[m]=="number"&&(delete o[m],this.getStorage(y)?.set(e.TARGET_KEY,JSON.stringify(o),t))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(m){switch(m){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(m){const y=this.getStorage(m);return y?h(y):Object.create(null)}isNew(m){return this.getBoolean(e.IS_NEW_KEY,m)===!0}async flush(m=P.NONE){this._onWillSaveState.fire({reason:m});const y=this.getStorage(-1),T=this.getStorage(0),t=this.getStorage(1);switch(m){case P.NONE:await I.Promises.settled([y?.whenFlushed()??Promise.resolve(),T?.whenFlushed()??Promise.resolve(),t?.whenFlushed()??Promise.resolve()]);break;case P.SHUTDOWN:await I.Promises.settled([y?.flush(0)??Promise.resolve(),T?.flush(0)??Promise.resolve(),t?.flush(0)??Promise.resolve()]);break}}async log(){const m=this.getStorage(-1)?.items??new Map,y=this.getStorage(0)?.items??new Map,T=this.getStorage(1)?.items??new Map;return d(m,y,T,this.getLogDetails(-1)??"",this.getLogDetails(0)??"",this.getLogDetails(1)??"")}async switch(m,y){return this.emitWillSaveState(P.NONE),(0,S.isUserDataProfile)(m)?this.switchToProfile(m,y):this.switchToWorkspace(m,y)}canSwitchProfile(m,y){return!(m.id===y.id||w(y)&&w(m))}switchData(m,y,T){this.withPausedEmitters(()=>{const t=new Set;for(const[o,n]of m)t.add(o),y.get(o)!==n&&this.emitDidChangeValue(T,{key:o,external:!0});for(const[o]of y.items)t.has(o)||this.emitDidChangeValue(T,{key:o,external:!0})})}}e.AbstractStorageService=f;function w(c){return c.isDefault||!!c.useDefaultFlags?.globalState}e.isProfileUsingDefaultStorage=w;class l extends f{constructor(){super(),this.applicationStorage=this._register(new D.Storage(new D.InMemoryStorageDatabase,{hint:D.StorageHint.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new D.Storage(new D.InMemoryStorageDatabase,{hint:D.StorageHint.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new D.Storage(new D.InMemoryStorageDatabase,{hint:D.StorageHint.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(m=>this.emitDidChangeValue(1,m))),this._register(this.profileStorage.onDidChangeStorage(m=>this.emitDidChangeValue(0,m))),this._register(this.applicationStorage.onDidChangeStorage(m=>this.emitDidChangeValue(-1,m)))}getStorage(m){switch(m){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(m){switch(m){case-1:return"inMemory (application)";case 0:return"inMemory (profile)";default:return"inMemory (workspace)"}}async doInitialize(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(m){return!1}}e.InMemoryStorageService=l;async function d(c,m,y,T,t,o){const n=U=>{try{return JSON.parse(U)}catch{return U}},s=new Map,i=new Map;c.forEach((U,F)=>{s.set(F,U),i.set(F,n(U))});const r=new Map,a=new Map;m.forEach((U,F)=>{r.set(F,U),a.set(F,n(U))});const E=new Map,v=new Map;y.forEach((U,F)=>{E.set(F,U),v.set(F,n(U))}),console.group(T!==t?`Storage: Application (path: ${T})`:`Storage: Application & Profile (path: ${T}, default profile)`);const u=[];if(s.forEach((U,F)=>{u.push({key:F,value:U})}),console.table(u),console.groupEnd(),console.log(i),T!==t){console.group(`Storage: Profile (path: ${t}, profile specific)`);const U=[];r.forEach((F,M)=>{U.push({key:M,value:F})}),console.table(U),console.groupEnd(),console.log(a)}console.group(`Storage: Workspace (path: ${o})`);const C=[];E.forEach((U,F)=>{C.push({key:F,value:U})}),console.table(C),console.groupEnd(),console.log(v)}e.logStorage=d}),define(ce[115],le([0,1,3,2,12,29,33,19]),function(te,e,I,O,A,_,k,D){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StorageManager=e.GlobalExtensionEnablementService=void 0;let b=class extends O.Disposable{constructor(p,g){super(),this._onDidChangeEnablement=new I.Emitter,this.onDidChangeEnablement=this._onDidChangeEnablement.event,this.storageManger=this._register(new S(p)),this._register(this.storageManger.onDidChange(h=>this._onDidChangeEnablement.fire({extensions:h,source:"storage"}))),this._register(g.onDidInstallExtensions(h=>h.forEach(({local:f,operation:w})=>{f&&w===4&&this._removeFromDisabledExtensions(f.identifier)})))}async enableExtension(p,g){return this._removeFromDisabledExtensions(p)?(this._onDidChangeEnablement.fire({extensions:[p],source:g}),!0):!1}async disableExtension(p,g){return this._addToDisabledExtensions(p)?(this._onDidChangeEnablement.fire({extensions:[p],source:g}),!0):!1}getDisabledExtensions(){return this._getExtensions(_.DISABLED_EXTENSIONS_STORAGE_PATH)}async getDisabledExtensionsAsync(){return this.getDisabledExtensions()}_addToDisabledExtensions(p){const g=this.getDisabledExtensions();return g.every(h=>!(0,k.areSameExtensions)(h,p))?(g.push(p),this._setDisabledExtensions(g),!0):!1}_removeFromDisabledExtensions(p){const g=this.getDisabledExtensions();for(let h=0;h<g.length;h++){const f=g[h];if((0,k.areSameExtensions)(f,p))return g.splice(h,1),this._setDisabledExtensions(g),!0}return!1}_setDisabledExtensions(p){this._setExtensions(_.DISABLED_EXTENSIONS_STORAGE_PATH,p)}_getExtensions(p){return this.storageManger.get(p,0)}_setExtensions(p,g){this.storageManger.set(p,g,0)}};e.GlobalExtensionEnablementService=b,e.GlobalExtensionEnablementService=b=Ee([G(0,D.IStorageService),G(1,_.IExtensionManagementService)],b);class S extends O.Disposable{constructor(p){super(),this.storageService=p,this.storage=Object.create(null),this._onDidChange=this._register(new I.Emitter),this.onDidChange=this._onDidChange.event,this._register(p.onDidChangeValue(0,void 0,this._register(new O.DisposableStore))(g=>this.onDidStorageChange(g)))}get(p,g){let h;return g===0?((0,A.isUndefinedOrNull)(this.storage[p])&&(this.storage[p]=this._get(p,g)),h=this.storage[p]):h=this._get(p,g),JSON.parse(h)}set(p,g,h){const f=JSON.stringify(g.map(({id:l,uuid:d})=>({id:l,uuid:d})));this._get(p,h)!==f&&(h===0&&(g.length?this.storage[p]=f:delete this.storage[p]),this._set(p,g.length?f:void 0,h))}onDidStorageChange(p){if(!(0,A.isUndefinedOrNull)(this.storage[p.key])&&this._get(p.key,p.scope)!==this.storage[p.key]){const h=this.get(p.key,p.scope);delete this.storage[p.key];const f=this.get(p.key,p.scope),w=h.filter(d=>!f.some(c=>(0,k.areSameExtensions)(d,c))),l=f.filter(d=>!h.some(c=>(0,k.areSameExtensions)(c,d)));(w.length||l.length)&&this._onDidChange.fire([...w,...l])}}_get(p,g){return this.storageService.get(p,g,"[]")}_set(p,g,h){g?this.storageService.store(p,g,h,1):this.storageService.remove(p,h)}}e.StorageManager=S}),define(ce[247],le([0,1,20,25,8,6,37,12,11,18,15,29,33,41,66,13,7,23,57,224,19,21]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionGalleryServiceWithNoStorageService=e.ExtensionGalleryService=e.sortExtensionVersions=void 0;const t=_.isWeb?"web":(0,p.getTargetPlatform)(_.platform,k.arch),o="X-Market-Search-Activity-Id";var n;(function(L){L[L.None=0]="None",L[L.IncludeVersions=1]="IncludeVersions",L[L.IncludeFiles=2]="IncludeFiles",L[L.IncludeCategoryAndTags=4]="IncludeCategoryAndTags",L[L.IncludeSharedAccounts=8]="IncludeSharedAccounts",L[L.IncludeVersionProperties=16]="IncludeVersionProperties",L[L.ExcludeNonValidated=32]="ExcludeNonValidated",L[L.IncludeInstallationTargets=64]="IncludeInstallationTargets",L[L.IncludeAssetUri=128]="IncludeAssetUri",L[L.IncludeStatistics=256]="IncludeStatistics",L[L.IncludeLatestVersionOnly=512]="IncludeLatestVersionOnly",L[L.Unpublished=4096]="Unpublished",L[L.IncludeNameConflictInfo=32768]="IncludeNameConflictInfo"})(n||(n={}));function s(...L){return String(L.reduce((N,W)=>N|W,0))}var i;(function(L){L[L.Tag=1]="Tag",L[L.ExtensionId=4]="ExtensionId",L[L.Category=5]="Category",L[L.ExtensionName=7]="ExtensionName",L[L.Target=8]="Target",L[L.Featured=9]="Featured",L[L.SearchText=10]="SearchText",L[L.ExcludeWithFlags=12]="ExcludeWithFlags"})(i||(i={}));const r={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source",Signature:"Microsoft.VisualStudio.Services.VsixSignature",DownloadPage:"Microsoft.SQLOps.DownloadPage"},a={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",PreRelease:"Microsoft.VisualStudio.Code.PreRelease",AzDataEngine:"Microsoft.AzDataEngine",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages",WebExtension:"Microsoft.VisualStudio.Code.WebExtension",SponsorLink:"Microsoft.VisualStudio.Code.SponsorLink"},v={pageNumber:1,pageSize:10,sortBy:0,sortOrder:0,flags:n.None,criteria:[],assetTypes:[]};class u{constructor(N=v){this.state=N}get pageNumber(){return this.state.pageNumber}get pageSize(){return this.state.pageSize}get sortBy(){return this.state.sortBy}get sortOrder(){return this.state.sortOrder}get flags(){return this.state.flags}get criteria(){return this.state.criteria?this.state.criteria:[]}withPage(N,W=this.state.pageSize){return new u({...this.state,pageNumber:N,pageSize:W})}withFilter(N,...W){const X=[...this.state.criteria,...W.length?W.map(ne=>({filterType:N,value:ne})):[{filterType:N}]];return new u({...this.state,criteria:X})}withSortBy(N){return new u({...this.state,sortBy:N})}withSortOrder(N){return new u({...this.state,sortOrder:N})}withFlags(...N){return new u({...this.state,flags:N.reduce((W,X)=>W|X,0)})}withAssetTypes(...N){return new u({...this.state,assetTypes:N})}withSource(N){return new u({...this.state,source:N})}get raw(){const{criteria:N,pageNumber:W,pageSize:X,sortBy:ne,sortOrder:re,flags:Q,assetTypes:ee}=this.state;return{filters:[{criteria:N,pageNumber:W,pageSize:X,sortBy:ne,sortOrder:re}],assetTypes:ee,flags:Q}}get searchText(){const N=this.state.criteria.filter(W=>W.filterType===i.SearchText)[0];return N&&N.value?N.value:""}get telemetryData(){return{filterTypes:this.state.criteria.map(N=>String(N.filterType)),flags:this.state.flags,sortBy:String(this.sortBy),sortOrder:String(this.sortOrder),pageNumber:String(this.pageNumber),source:this.state.source,searchTextLength:this.searchText.length}}}function C(L,N){const W=(L||[]).filter(X=>X.statisticName===N)[0];return W?W.value:0}function U(L){const N="Microsoft.VisualStudio.Code.Translation.";return L.files.filter(X=>X.assetType.indexOf(N)===0).reduce((X,ne)=>{const re=z(L,ne.assetType);return re&&X.push([ne.assetType.substring(N.length),re]),X},[])}function F(L){if(L.properties){const N=L.properties.filter(ne=>ne.key===r.Repository),W=new RegExp("((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@:/\\-~]+)(.git)(/)?"),X=N.filter(ne=>W.test(ne.value))[0];return X?{uri:X.value,fallbackUri:X.value}:null}return z(L,r.Repository)}function M(L){const N=z(L,r.VSIX);return N||{uri:`${L.fallbackAssetUri}/${r.VSIX}?redirect=true${L.targetPlatform?`&targetPlatform=${L.targetPlatform}`:""}`,fallbackUri:`${L.fallbackAssetUri}/${r.VSIX}${L.targetPlatform?`?targetPlatform=${L.targetPlatform}`:""}`}}function z(L,N){const W=L.files.filter(ne=>ne.assetType===N)[0];let X;return W&&(X=W.source),N===r.VSIX?{uri:X||`${L.fallbackAssetUri}/${N}?redirect=true`,fallbackUri:`${L.fallbackAssetUri}/${N}`}:L.assetUri?{uri:`${L.assetUri}/${N}`,fallbackUri:`${L.fallbackAssetUri}/${N}`}:W?{uri:X,fallbackUri:`${L.fallbackAssetUri}/${N}`}:null}function V(L,N){const W=L.properties?L.properties.filter(ne=>ne.key===N):[],X=W.length>0&&W[0].value;return X?X.split(",").map(ne=>(0,g.adoptToGalleryExtensionId)(ne)):[]}function J(L){const N=L.properties?L.properties.filter(W=>W.key===a.Engine):[];return N.length>0&&N[0].value||""}function H(L){const N=L.properties?L.properties.filter(W=>W.key===a.AzDataEngine):[];return N.length>0&&N[0].value||""}function Y(L){const N=L.properties?L.properties.filter(W=>W.key===a.PreRelease):[];return N.length>0&&N[0].value==="true"}function B(L){const N=L.properties?L.properties.filter(X=>X.key===a.LocalizedLanguages):[],W=N.length>0&&N[0].value||"";return W?W.split(","):[]}function K(L){return L.properties?.find(N=>N.key===a.SponsorLink)?.value}function x(L){return L.indexOf("preview")!==-1}function q(L){return L.targetPlatform?(0,p.toTargetPlatform)(L.targetPlatform):"undefined"}function j(L){const N=(0,I.distinct)(L.versions.map(q)),W=!!L.tags?.includes(p.WEB_EXTENSION_TAG),X=N.indexOf("web");return W?X===-1&&N.push("web"):X!==-1&&N.splice(X,1),N}function Z(L,N){const W=(0,p.getFallbackTargetPlarforms)(N);for(let X=0;X<L.length;X++){const ne=L[X];if(ne.version===L[X-1]?.version){let re=X;const Q=q(ne);if(Q===N)for(;re>0&&L[re-1].version===ne.version;)re--;else if(W.includes(Q))for(;re>0&&L[re-1].version===ne.version&&q(L[re-1])!==N;)re--;re!==X&&(L.splice(X,1),L.splice(re,0,ne))}}return L}e.sortExtensionVersions=Z;function oe(L,N,W){L.telemetryData={index:N,querySource:W,queryActivityId:L.queryContext?.[o]}}function ue(L,N,W,X){const ne=L.versions[0],re={manifest:z(N,r.Manifest),readme:z(N,r.Details),changelog:z(N,r.Changelog),license:z(N,r.License),repository:F(N),download:M(N),downloadPage:z(N,r.DownloadPage),icon:z(N,r.Icon),signature:z(N,r.Signature),coreTranslations:U(N)};return{identifier:{id:(0,g.getGalleryExtensionId)(L.publisher.publisherName,L.extensionName),uuid:L.extensionId},name:L.extensionName,version:N.version,displayName:L.displayName,publisherId:L.publisher.publisherId,publisher:L.publisher.publisherName,publisherDisplayName:L.publisher.displayName,publisherDomain:L.publisher.domain?{link:L.publisher.domain,verified:!!L.publisher.isDomainVerified}:void 0,publisherSponsorLink:K(ne),description:L.shortDescription||"",installCount:C(L.statistics,"install"),rating:C(L.statistics,"averagerating"),ratingCount:C(L.statistics,"ratingcount"),categories:L.categories||[],tags:L.tags||[],releaseDate:Date.parse(L.releaseDate),lastUpdated:Date.parse(N.lastUpdated),allTargetPlatforms:W,assets:re,properties:{dependencies:V(N,a.Dependency),extensionPack:V(N,a.ExtensionPack),engine:J(N),azDataEngine:H(N),localizedLanguages:B(N),targetPlatform:q(N),isPreReleaseVersion:Y(N)},hasPreReleaseVersion:Y(ne),hasReleaseVersion:!0,preview:x(L.flags),isSigned:!!re.signature,queryContext:X}}let ae=class{constructor(N,W,X,ne,re,Q,ee,ie){this.requestService=W,this.logService=X,this.environmentService=ne,this.telemetryService=re,this.fileService=Q,this.productService=ee,this.configurationService=ie;const de=ee.extensionsGallery,fe=de?.servicePPEUrl&&ie.getValue("_extensionsGallery.enablePPE");this.extensionsGalleryUrl=fe?de.servicePPEUrl:de?.serviceUrl,this.extensionsControlUrl=de?.controlUrl,this.commonHeadersPromise=(0,m.resolveMarketplaceHeaders)(ee.version,ee,this.environmentService,this.configurationService,this.fileService,N,this.telemetryService)}api(N=""){return`${this.extensionsGalleryUrl}`}isEnabled(){return!!this.extensionsGalleryUrl}async getExtensions(N,W,X){const ne=O.CancellationToken.isCancellationToken(W)?{}:W,re=O.CancellationToken.isCancellationToken(W)?W:X,Q=[],ee=[],ie=[],de=[];let fe=!0;for(const De of N){De.uuid?ee.push(De.uuid):Q.push(De.id);const ke=!!(De.version||De.preRelease);ie.push({id:De.id,uuid:De.uuid,includePreRelease:ke}),De.version&&de.push({id:De.id,uuid:De.uuid,version:De.version}),fe=fe&&!!De.hasPreRelease&&!ke}if(!ee.length&&!Q.length)return[];let pe=new u().withPage(1,N.length);ee.length&&(pe=pe.withFilter(i.ExtensionId,...ee)),Q.length&&(pe=pe.withFilter(i.ExtensionName,...Q)),(ne.queryAllVersions||fe)&&(pe=pe.withFlags(pe.flags,n.IncludeVersions)),ne.source&&(pe=pe.withSource(ne.source));const{extensions:ye}=await this.queryGalleryExtensions(pe,{targetPlatform:ne.targetPlatform??t,includePreRelease:ie,versions:de,compatible:!!ne.compatible},re);return ne.source&&ye.forEach((De,ke)=>oe(De,ke,ne.source)),ye}async getCompatibleExtension(N,W,X){return N?Promise.resolve(N):null}async isExtensionCompatible(N,W,X){if(!(0,p.isTargetPlatformCompatible)(N.properties.targetPlatform,N.allTargetPlatforms,X)||!W&&N.properties.isPreReleaseVersion)return!1;let ne=N.properties.engine;if(!ne){const re=await this.getManifest(N,O.CancellationToken.None);if(!re)throw new Error("Manifest was not found");ne=re.engines.vscode}return(0,f.isEngineValid)(ne,this.productService.version,this.productService.date)}async isValidVersion(N,W,X,ne,re){if(!(0,p.isTargetPlatformCompatible)(q(N),ne,re)||W!=="any"&&Y(N)!==(W==="prerelease"))return!1;if(X)try{const Q=await this.getEngine(N);if(!(0,f.isEngineValid)(Q,this.productService.version,this.productService.date))return!1}catch(Q){return this.logService.error(`Error while getting the engine for the version ${N.version}.`,(0,A.getErrorMessage)(Q)),!1}return!0}async query(N,W){let X=N.text||"";const ne=N.pageSize??50;let re=new u().withPage(1,ne);N.excludeFlags&&(re=re.withFilter(i.ExcludeWithFlags,N.excludeFlags)),X?(X=X.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(fe,pe,ye)=>(re=re.withFilter(i.Category,ye||pe),"")),X=X.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(fe,pe,ye)=>(re=re.withFilter(i.Tag,ye||pe),"")),X=X.replace(/\bfeatured(\s+|\b|$)/g,()=>(re=re.withFilter(i.Featured),"")),X=X.trim(),X&&(X=X.length<200?X:X.substring(0,200),re=re.withFilter(i.SearchText,X)),re=re.withSortBy(0)):N.ids?re=re.withFilter(i.ExtensionId,...N.ids):N.names?re=re.withFilter(i.ExtensionName,...N.names):re=re.withSortBy(4),typeof N.sortBy=="number"&&(re=re.withSortBy(N.sortBy)),typeof N.sortOrder=="number"&&(re=re.withSortOrder(N.sortOrder)),N.source&&(re=re.withSource(N.source));const Q=async(fe,pe)=>{const{extensions:ye,total:De}=await this.queryGalleryExtensions(fe,{targetPlatform:t,compatible:!1,includePreRelease:!!N.includePreRelease},pe);return ye.forEach((ke,Ue)=>oe(ke,(fe.pageNumber-1)*fe.pageSize+Ue,N.source)),{extensions:ye,total:De}},{extensions:ee,total:ie}=await Q(re,W),de=async(fe,pe)=>{if(pe.isCancellationRequested)throw new A.CancellationError;const{extensions:ye}=await Q(re.withPage(fe+1),pe);return ye};return{firstPage:ee,total:ie,pageSize:ee.length,getPage:de}}async queryGalleryExtensions(N,W,X){const ne=N.flags;N.flags&n.IncludeLatestVersionOnly&&N.flags&n.IncludeVersions&&(N=N.withFlags(N.flags&~n.IncludeVersions,n.IncludeLatestVersionOnly)),!(N.flags&n.IncludeLatestVersionOnly)&&!(N.flags&n.IncludeVersions)&&(N=N.withFlags(N.flags,n.IncludeLatestVersionOnly)),W.versions?.length&&(N=N.withFlags(N.flags&~n.IncludeLatestVersionOnly,n.IncludeVersions)),N=N.withFlags(N.flags,n.IncludeAssetUri,n.IncludeCategoryAndTags,n.IncludeFiles,n.IncludeStatistics,n.IncludeVersionProperties);const{galleryExtensions:re,total:Q,context:ee}=await this.queryRawGalleryExtensions(N,X);if(!(N.flags&n.IncludeLatestVersionOnly)){const pe=[];for(const ye of re){const De=await this.toGalleryExtensionWithCriteria(ye,W,ee);De&&pe.push(De)}return{extensions:pe,total:Q}}const de=[],fe=new Map;for(let pe=0;pe<re.length;pe++){const ye=re[pe],De={id:(0,g.getGalleryExtensionId)(ye.publisher.publisherName,ye.extensionName),uuid:ye.extensionId},ke=(0,D.isBoolean)(W.includePreRelease)?W.includePreRelease:!!W.includePreRelease.find(he=>(0,g.areSameExtensions)(he,De))?.includePreRelease;if(W.compatible&&(0,p.isNotWebExtensionInWebTargetPlatform)(j(ye),W.targetPlatform))continue;const Ue=await this.toGalleryExtensionWithCriteria(ye,W,ee);!Ue||Ue.properties.isPreReleaseVersion&&(!ke||!Ue.hasReleaseVersion)||!Ue.properties.isPreReleaseVersion&&Ue.properties.targetPlatform!==W.targetPlatform&&Ue.hasPreReleaseVersion?fe.set(ye.extensionId,pe):de.push([pe,Ue])}if(fe.size){const pe=new u().withFlags(ne&~n.IncludeLatestVersionOnly,n.IncludeVersions).withPage(1,fe.size).withFilter(i.ExtensionId,...fe.keys()),{extensions:ye}=await this.queryGalleryExtensions(pe,W,X);for(const De of ye){const ke=fe.get(De.identifier.uuid);de.push([ke,De])}}return{extensions:de.sort((pe,ye)=>pe[0]-ye[0]).map(([,pe])=>pe),total:Q}}async toGalleryExtensionWithCriteria(N,W,X){const ne={id:(0,g.getGalleryExtensionId)(N.publisher.publisherName,N.extensionName),uuid:N.extensionId},re=W.versions?.find(de=>(0,g.areSameExtensions)(de,ne))?.version,Q=(0,D.isBoolean)(W.includePreRelease)?W.includePreRelease:!!W.includePreRelease.find(de=>(0,g.areSameExtensions)(de,ne))?.includePreRelease,ee=j(N),ie=Z(N.versions,W.targetPlatform);if(W.compatible&&(0,p.isNotWebExtensionInWebTargetPlatform)(ee,W.targetPlatform))return null;for(let de=0;de<ie.length;de++){const fe=ie[de];if(!(re&&fe.version!==re)){if(await this.isValidVersion(fe,Q?"any":"release",W.compatible,ee,W.targetPlatform))return ue(N,fe,ee,X);if(re&&fe.version===re)return null}}return re||W.compatible?null:ue(N,N.versions[0],ee)}createQueryResult(N,W){let X=W;if(N.criteria){const Q=N.criteria.filter(ye=>ye.filterType===i.ExtensionId).map(ye=>ye.value?ye.value.toLocaleLowerCase():void 0);Q&&Q.length>0&&(X=X.filter(ye=>ye.extensionId&&Q.find(De=>De===ye.extensionId.toLocaleLowerCase())));const ee=N.criteria.filter(ye=>ye.filterType===i.ExtensionName).map(ye=>ye.value?ye.value.toLocaleLowerCase():void 0);ee&&ee.length>0&&(X=X.filter(ye=>ye.extensionName&&ye.publisher.publisherName&&ee.find(De=>De===`${ye.publisher.publisherName.toLocaleLowerCase()}.${ye.extensionName.toLocaleLowerCase()}`)));const ie=N.criteria.filter(ye=>ye.filterType===i.Category).map(ye=>ye.value?ye.value.toLowerCase():void 0);ie&&ie.length>0&&ie.find(ye=>ye==="language packs")&&(X=X.filter(ye=>{if(ye.versions.length===1){const De=j(ye),ke=ue(ye,ye.versions[0],De);return ke.properties.localizedLanguages&&ke.properties.localizedLanguages.length>0}return!1})),N.criteria.filter(ye=>ye.filterType===i.Tag)?.length>0&&(X=[]);const fe=N.criteria.filter(ye=>ye.filterType===i.SearchText).map(ye=>ye.value?ye.value.toLocaleLowerCase():void 0);fe&&fe.length>0&&fe.forEach(ye=>{ye!=="@allmarketplace"&&(X=X.filter(De=>$.isMatchingExtension(De,ye)))});const pe=N.criteria.filter(ye=>ye.filterType===i.ExcludeWithFlags).map(ye=>ye.value?ye.value.toLocaleLowerCase():void 0);pe&&pe.length>0&&(X=X.filter(ye=>!ye.flags||pe.find(De=>De===ye.flags.toLocaleLowerCase())===void 0))}switch(N.sortBy){case 3:X.sort((Q,ee)=>$.compareByField(Q.publisher,ee.publisher,"publisherName"));break;case 2:default:X.sort((Q,ee)=>$.compareByField(Q,ee,"displayName"));break}let ne=X.length;return this.configurationService.getValue(h.ExtensionsPolicyKey)===h.ExtensionsPolicy.allowMicrosoft&&(X=X.filter(Q=>Q.publisher&&Q.publisher.displayName==="Microsoft")),{galleryExtensions:X,total:ne}}static isMatchingExtension(N,W){if(!W)return!0;let X=W.toLocaleLowerCase();return!!N&&!!(N.extensionName&&N.extensionName.toLocaleLowerCase().indexOf(X)>-1||N.publisher&&N.publisher.publisherName&&N.publisher.publisherName.toLocaleLowerCase().indexOf(X)>-1||N.publisher&&N.publisher.displayName&&N.publisher.displayName.toLocaleLowerCase().indexOf(X)>-1||N.displayName&&N.displayName.toLocaleLowerCase().indexOf(X)>-1||N.shortDescription&&N.shortDescription.toLocaleLowerCase().indexOf(X)>-1||N.extensionId&&N.extensionId.toLocaleLowerCase().indexOf(X)>-1)}static compareByField(N,W,X){return N&&!W?1:W&&!N?-1:N&&N[X]&&(!W||!W[X])?1:W&&W[X]&&(!N||!N[X])?-1:!W||!W[X]&&(!N||!N[X])||N[X]===W[X]?0:N[X]<W[X]?-1:1}async queryRawGalleryExtensions(N,W){if(!this.isEnabled())throw new Error("No extension gallery service configured.");N=N.withFlags(N.flags,n.ExcludeNonValidated).withFilter(i.Target,"Microsoft.VisualStudio.Code").withFilter(i.ExcludeWithFlags,s(n.Unpublished));const X=await this.commonHeadersPromise,ne=JSON.stringify(N.raw),re={...X,"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":String(ne.length)},Q=await this.requestService.request({type:"GET",url:this.api("/extensionquery"),data:ne,headers:re},W);let ee=this.configurationService.getValue(h.ExtensionsPolicyKey);if(Q.res.statusCode&&Q.res.statusCode>=400&&Q.res.statusCode<500||ee===h.ExtensionsPolicy.allowNone)return{galleryExtensions:[],total:0};const ie=await(0,c.asJson)(Q);if(ie){const fe=ie.results[0].extensions;fe.forEach(ye=>Z(ye.versions,"universal"));let pe=this.createQueryResult(N,fe);return{galleryExtensions:pe.galleryExtensions,total:pe.total}}return{galleryExtensions:[],total:0}}async reportStatistic(N,W,X,ne){if(!this.isEnabled())return;const re=_.isWeb?this.api(`/itemName/${N}.${W}/version/${X}/statType/${ne==="install"?"1":"3"}/vscodewebextension`):this.api(`/publishers/${N}/extensions/${W}/${X}/stats?statType=${ne}`),Q=_.isWeb?"api-version=6.1-preview.1":"*/*;api-version=4.0-preview.1",ie={...await this.commonHeadersPromise,Accept:Q};try{await this.requestService.request({type:"POST",url:re,headers:ie},O.CancellationToken.None)}catch{}}async download(N,W,X){this.logService.trace("ExtensionGalleryService#download",N.identifier.id);const ne=(0,g.getGalleryExtensionTelemetryData)(N),re=new Date().getTime(),Q=pe=>this.telemetryService.publicLog("galleryService:downloadVSIX",{...ne,duration:pe}),ee=void 0,ie=ee?{uri:`${N.assets.download.uri}${b.URI.parse(N.assets.download.uri).query?"&":"?"}${ee}=true`,fallbackUri:`${N.assets.download.fallbackUri}${b.URI.parse(N.assets.download.fallbackUri).query?"&":"?"}${ee}=true`}:N.assets.download,de=N.queryContext?.[o]?{[o]:N.queryContext[o]}:void 0,fe=await this.getAsset(ie,de?{headers:de}:void 0);await this.fileService.writeFile(W,fe.stream),Q(new Date().getTime()-re)}async downloadSignatureArchive(N,W){if(!N.assets.signature)throw new Error("No signature asset found");this.logService.trace("ExtensionGalleryService#downloadSignatureArchive",N.identifier.id);const X=await this.getAsset(N.assets.signature);await this.fileService.writeFile(W,X.stream)}async getReadme(N,W){if(N.assets.readme){const X=await this.getAsset(N.assets.readme,{},W);return await(0,c.asTextOrError)(X)||""}return""}async getManifest(N,W){if(N.assets.manifest){const X=await this.getAsset(N.assets.manifest,{},W),ne=await(0,c.asTextOrError)(X);return ne?JSON.parse(ne):null}return null}async getManifestFromRawExtensionVersion(N,W){const X=z(N,r.Manifest);if(!X)throw new Error("Manifest was not found");const ne={"Accept-Encoding":"gzip"},re=await this.getAsset(X,{headers:ne});return await(0,c.asJson)(re)}async getCoreTranslation(N,W){const X=N.assets.coreTranslations.filter(ne=>ne[0]===W.toUpperCase())[0];if(X){const ne=await this.getAsset(X[1]),re=await(0,c.asTextOrError)(ne);return re?JSON.parse(re):null}return null}async getChangelog(N,W){if(N.assets.changelog){const X=await this.getAsset(N.assets.changelog,{},W);return await(0,c.asTextOrError)(X)||""}return""}async getAllCompatibleVersions(N,W,X){let ne=new u().withFlags(n.IncludeVersions,n.IncludeCategoryAndTags,n.IncludeFiles,n.IncludeVersionProperties).withPage(1,1);N.identifier.uuid?ne=ne.withFilter(i.ExtensionId,N.identifier.uuid):ne=ne.withFilter(i.ExtensionName,N.identifier.id);const{galleryExtensions:re}=await this.queryRawGalleryExtensions(ne,O.CancellationToken.None);if(!re.length)return[];const Q=j(re[0]);if((0,p.isNotWebExtensionInWebTargetPlatform)(Q,X))return[];const ee=[];await Promise.all(re[0].versions.map(async fe=>{try{await this.isValidVersion(fe,W?"any":"release",!0,Q,X)&&ee.push(fe)}catch{}}));const ie=[],de=new Set;for(const fe of Z(ee,X))de.has(fe.version)||(de.add(fe.version),ie.push({version:fe.version,date:fe.lastUpdated,isPreReleaseVersion:Y(fe)}));return ie}async getAsset(N,W={},X=O.CancellationToken.None){const ne={},re={type:"GET"},Q={...ne,...W.headers||{}};W={...W,...re,headers:Q};const ee=N.uri,ie=N.fallbackUri,de={...W,url:ee};try{const fe=await this.requestService.request(de,X);if(fe.res.statusCode===200)return fe;const pe=await(0,c.asTextOrError)(fe);throw new Error(`Expected 200, got back ${fe.res.statusCode} instead.

${pe}`)}catch(fe){if((0,A.isCancellationError)(fe))throw fe;const pe=(0,A.getErrorMessage)(fe);this.telemetryService.publicLog2("galleryService:cdnFallback",{url:ee,message:pe});const ye={...W,url:ie};return this.requestService.request(ye,X)}}async getEngine(N){let W=J(N);if(!W){const X=await this.getManifestFromRawExtensionVersion(N,O.CancellationToken.None);if(!X)throw new Error("Manifest was not found");W=X.engines.vscode}return W}async getExtensionsControlManifest(){if(!this.isEnabled())throw new Error("No extension gallery service configured.");if(!this.extensionsControlUrl)return{malicious:[],deprecated:{},search:[]};const N=await this.requestService.request({type:"GET",url:this.extensionsControlUrl},O.CancellationToken.None);if(N.res.statusCode!==200)throw new Error("Could not get extensions report.");const W=await(0,c.asJson)(N),X=[],ne={},re=[];if(W){for(const Q of W.malicious)X.push({id:Q});if(W.migrateToPreRelease)for(const[Q,ee]of Object.entries(W.migrateToPreRelease))(!ee.engine||(0,f.isEngineValid)(ee.engine,this.productService.version,this.productService.date))&&(ne[Q.toLowerCase()]={disallowInstall:!0,extension:{id:ee.id,displayName:ee.displayName,autoMigrate:{storage:!!ee.migrateStorage},preRelease:!0}});if(W.deprecated)for(const[Q,ee]of Object.entries(W.deprecated))ee&&(ne[Q.toLowerCase()]=(0,D.isBoolean)(ee)?{}:ee);if(W.search)for(const Q of W.search)re.push(Q)}return{malicious:X,deprecated:ne,search:re}}};ae=Ee([G(1,c.IRequestService),G(2,l.ILogService),G(3,P.IEnvironmentService),G(4,T.ITelemetryService),G(5,w.IFileService),G(6,d.IProductService),G(7,S.IConfigurationService)],ae);let $=class extends ae{constructor(N,W,X,ne,re,Q,ee,ie){super(N,W,X,ne,re,Q,ee,ie)}};e.ExtensionGalleryService=$,e.ExtensionGalleryService=$=Ee([G(0,y.IStorageService),G(1,c.IRequestService),G(2,l.ILogService),G(3,P.IEnvironmentService),G(4,T.ITelemetryService),G(5,w.IFileService),G(6,d.IProductService),G(7,S.IConfigurationService)],$);let R=class extends ae{constructor(N,W,X,ne,re,Q,ee){super(void 0,N,W,X,ne,re,Q,ee)}};e.ExtensionGalleryServiceWithNoStorageService=R,e.ExtensionGalleryServiceWithNoStorageService=R=Ee([G(0,c.IRequestService),G(1,l.ILogService),G(2,P.IEnvironmentService),G(3,T.ITelemetryService),G(4,w.IFileService),G(5,d.IProductService),G(6,S.IConfigurationService)],R)}),define(ce[80],le([0,1,4,3,2,19,33,23,20,7,12]),function(te,e,I,O,A,_,k,D,b,S,P){"use strict";var p;Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionStorageService=e.IExtensionStorageService=void 0,e.IExtensionStorageService=(0,I.createDecorator)("IExtensionStorageService");const g=/^extensionKeys\/([^.]+\..+)@(\d+\.\d+\.\d+(-.*)?)$/;let h=class extends A.Disposable{static{p=this}static{this.LARGE_STATE_WARNING_THRESHOLD=512*1024}static toKey(w){return`extensionKeys/${(0,k.adoptToGalleryExtensionId)(w.id)}@${w.version}`}static fromKey(w){const l=g.exec(w);if(l&&l[1])return{id:l[1],version:l[2]}}static async removeOutdatedExtensionVersions(w,l){const d=await w.getInstalled(),c=[];for(const[m,y]of p.readAllExtensionsWithKeysForSync(l)){const T=d.find(t=>(0,k.areSameExtensions)(t.identifier,{id:m}))?.manifest.version;for(const t of y)T!==t&&c.push(p.toKey({id:m,version:t}))}for(const m of c)l.remove(m,0)}static readAllExtensionsWithKeysForSync(w){const l=new Map,d=w.keys(0,1);for(const c of d){const m=p.fromKey(c);if(m){let y=l.get(m.id.toLowerCase());y||l.set(m.id.toLowerCase(),y=[]),y.push(m.version)}}return l}constructor(w,l,d){super(),this.storageService=w,this.productService=l,this.logService=d,this._onDidChangeExtensionStorageToSync=this._register(new O.Emitter),this.onDidChangeExtensionStorageToSync=this._onDidChangeExtensionStorageToSync.event,this.extensionsWithKeysForSync=p.readAllExtensionsWithKeysForSync(w),this._register(this.storageService.onDidChangeValue(0,void 0,this._register(new A.DisposableStore))(c=>this.onDidChangeStorageValue(c)))}onDidChangeStorageValue(w){if(this.extensionsWithKeysForSync.has(w.key.toLowerCase())){this._onDidChangeExtensionStorageToSync.fire();return}const l=p.fromKey(w.key);if(l){if(this.storageService.get(w.key,0)===void 0)this.extensionsWithKeysForSync.delete(l.id.toLowerCase());else{let d=this.extensionsWithKeysForSync.get(l.id.toLowerCase());d||this.extensionsWithKeysForSync.set(l.id.toLowerCase(),d=[]),d.push(l.version),this._onDidChangeExtensionStorageToSync.fire()}return}}getExtensionId(w){if((0,P.isString)(w))return w;const l=w.manifest?w.manifest.publisher:w.publisher,d=w.manifest?w.manifest.name:w.name;return(0,k.getExtensionId)(l,d)}getExtensionState(w,l){const d=this.getExtensionId(w),c=this.getExtensionStateRaw(w,l);if(c)try{return JSON.parse(c)}catch(m){this.logService.error(`[mainThreadStorage] unexpected error parsing storage contents (extensionId: ${d}, global: ${l}): ${m}`)}}getExtensionStateRaw(w,l){const d=this.getExtensionId(w),c=this.storageService.get(d,l?0:1);return c&&c?.length>p.LARGE_STATE_WARNING_THRESHOLD&&this.logService.warn(`[mainThreadStorage] large extension state detected (extensionId: ${d}, global: ${l}): ${c.length/1024}kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.`),c}setExtensionState(w,l,d){const c=this.getExtensionId(w);l===void 0?this.storageService.remove(c,d?0:1):this.storageService.store(c,JSON.stringify(l),d?0:1,1)}setKeysForSync(w,l){this.storageService.store(p.toKey(w),JSON.stringify(l),0,1)}getKeysForSync(w){const l=this.productService.extensionSyncedKeys?.[w.id.toLowerCase()],d=this.storageService.get(p.toKey(w),0),c=d?JSON.parse(d):void 0;return c&&l?(0,b.distinct)([...c,...l]):c||l}addToMigrationList(w,l){if(w!==l){const d=this.migrationList.filter(c=>!c.includes(w)&&!c.includes(l));d.push([w,l]),this.migrationList=d}}getSourceExtensionToMigrate(w){const l=this.migrationList.find(([,d])=>w===d);return l?l[0]:void 0}get migrationList(){const w=this.storageService.get("extensionStorage.migrationList",-1,"[]");try{const l=JSON.parse(w);if(Array.isArray(l))return l}catch{}return[]}set migrationList(w){w.length?this.storageService.store("extensionStorage.migrationList",JSON.stringify(w),-1,1):this.storageService.remove("extensionStorage.migrationList",-1)}};e.ExtensionStorageService=h,e.ExtensionStorageService=h=p=Ee([G(0,_.IStorageService),G(1,D.IProductService),G(2,S.ILogService)],h)}),define(ce[248],le([0,1,29,13,23,15,100,55,19,21,221]),function(te,e,I,O,A,_,k,D,b,S,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionTipsService=void 0;let p=class extends P.AbstractNativeExtensionTipsService{constructor(h,f,w,l,d,c,m,y){super(h.userHome,d,f,w,l,c,m,y)}};e.ExtensionTipsService=p,e.ExtensionTipsService=p=Ee([G(0,_.INativeEnvironmentService),G(1,S.ITelemetryService),G(2,I.IExtensionManagementService),G(3,b.IStorageService),G(4,D.INativeHostService),G(5,k.IExtensionRecommendationNotificationService),G(6,O.IFileService),G(7,A.IProductService)],p)}),define(ce[249],le([0,1,106,3,21,15,2,7,16,63,23,6,5,103,18,165,36,19,12,132]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteTunnelService=void 0;const y=[I.CONFIGURATION_KEY_HOST_NAME,I.CONFIGURATION_KEY_PREVENT_SLEEP],T="remoteTunnelSession",t="remoteTunnelIsService";let o=class extends k.Disposable{constructor(r,a,E,v,u,C,U){super(),this.telemetryService=r,this.productService=a,this.environmentService=E,this.configurationService=C,this.storageService=U,this._onDidTokenFailedEmitter=new O.Emitter,this.onDidTokenFailed=this._onDidTokenFailedEmitter.event,this._onDidChangeTunnelStatusEmitter=new O.Emitter,this.onDidChangeTunnelStatus=this._onDidChangeTunnelStatusEmitter.event,this._onDidChangeModeEmitter=new O.Emitter,this.onDidChangeMode=this._onDidChangeModeEmitter.event,this._mode=I.INACTIVE_TUNNEL_MODE,this._initialized=!1,this.defaultOnOutput=(F,M)=>{M?this._logger.error(F):this._logger.info(F)},this._logger=this._register(v.createLogger(I.LOG_ID,{name:I.LOGGER_NAME})),this._startTunnelProcessDelayer=new g.Delayer(100),this._register(this._logger.onDidChangeLogLevel(F=>this._logger.info("Log level changed to "+(0,D.LogLevelToString)(F)))),this._register(u.onWillShutdown(()=>{this._tunnelProcess?.cancel(),this._tunnelProcess=void 0,this.dispose()})),this._register(C.onDidChangeConfiguration(F=>{y.some(M=>F.affectsConfiguration(M))&&this._startTunnelProcessDelayer.trigger(()=>this.updateTunnelProcess())})),this._mode=this._restoreMode(),this._tunnelStatus=I.TunnelStates.uninitialized}async getTunnelStatus(){return this._tunnelStatus}setTunnelStatus(r){this._tunnelStatus=r,this._onDidChangeTunnelStatusEmitter.fire(r)}setMode(r){s(this._mode,r)||(this._mode=r,this._storeMode(r),this._onDidChangeModeEmitter.fire(this._mode),r.active?(this._logger.info(`Session updated: ${r.session.accountLabel} (${r.session.providerId}) (service=${r.asService})`),r.session.token&&this._logger.info(`Session token updated: ${r.session.accountLabel} (${r.session.providerId})`)):this._logger.info("Session reset"))}getMode(){return Promise.resolve(this._mode)}async initialize(r){if(this._initialized)return this._tunnelStatus;this._initialized=!0,this.setMode(r);try{await this._startTunnelProcessDelayer.trigger(()=>this.updateTunnelProcess())}catch(a){this._logger.error(a)}return this._tunnelStatus}getTunnelCommandLocation(){if(!this._tunnelCommand){let r;p.isMacintosh?r=this.environmentService.appRoot:r=(0,b.dirname)((0,b.dirname)(this.environmentService.appRoot)),this._tunnelCommand=(0,b.join)(r,"bin",`${this.productService.tunnelApplicationName}${p.isWindows?".exe":""}`)}return this._tunnelCommand}async startTunnel(r){if(s(this._mode,r)&&this._tunnelStatus.type!=="disconnected")return this._tunnelStatus;this.setMode(r);try{await this._startTunnelProcessDelayer.trigger(()=>this.updateTunnelProcess())}catch(a){this._logger.error(a)}return this._tunnelStatus}async stopTunnel(){if(this._tunnelProcess&&(this._tunnelProcess.cancel(),this._tunnelProcess=void 0),!this._mode.active)return;const r=this._mode.asService;this.setMode(I.INACTIVE_TUNNEL_MODE);try{r&&this.runCodeTunnelCommand("uninstallService",["service","uninstall"])}catch(a){this._logger.error(a)}try{await this.runCodeTunnelCommand("stop",["kill"])}catch(a){this._logger.error(a)}this.setTunnelStatus(I.TunnelStates.disconnected())}async updateTunnelProcess(){this.telemetryService.publicLog2("remoteTunnel.enablement",{enabled:this._mode.active,service:this._mode.active&&this._mode.asService}),this._tunnelProcess&&(this._tunnelProcess.cancel(),this._tunnelProcess=void 0);let r="",a=!1;const E=(M,z)=>{z?this._logger.error(M):r+=M,!this.environmentService.isBuilt&&M.startsWith("   Compiling")&&this.setTunnelStatus(I.TunnelStates.connecting((0,w.localize)(0,null)))},v=this.runCodeTunnelCommand("status",["status"],E);this._tunnelProcess=v;try{if(await v,this._tunnelProcess!==v)return;const M=JSON.parse(r.trim().split(`
`).find(z=>z.startsWith("{")));if(a=M.service_installed,this._logger.info(M.tunnel?"Other tunnel running, attaching...":"No other tunnel running"),!M.tunnel&&!this._mode.active){this.setTunnelStatus(I.TunnelStates.disconnected());return}}catch(M){this._logger.error(M),this.setTunnelStatus(I.TunnelStates.disconnected());return}finally{this._tunnelProcess===v&&(this._tunnelProcess=void 0)}const u=this._mode.active?this._mode.session:void 0;if(u&&u.token){const M=u.token;this.setTunnelStatus(I.TunnelStates.connecting((0,w.localize)(1,null,u.accountLabel,u.providerId)));const z=(J,H)=>{J=J.replaceAll(M,"*".repeat(4)),E(J,H)},V=this.runCodeTunnelCommand("login",["user","login","--provider",u.providerId,"--access-token",M,"--log",(0,D.LogLevelToString)(this._logger.getLevel())],z);this._tunnelProcess=V;try{if(await V,this._tunnelProcess!==V)return}catch(J){this._logger.error(J),this._tunnelProcess=void 0,this._onDidTokenFailedEmitter.fire(u),this.setTunnelStatus(I.TunnelStates.disconnected(u));return}}const C=this._getTunnelName();C?this.setTunnelStatus(I.TunnelStates.connecting((0,w.localize)(2,null,C))):this.setTunnelStatus(I.TunnelStates.connecting((0,w.localize)(3,null)));const U=["--accept-server-license-terms","--log",(0,D.LogLevelToString)(this._logger.getLevel())];C?U.push("--name",C):U.push("--random-name");let F=!1;return this._mode.active&&this._mode.asService&&!a&&(F=await this.installTunnelService(U)===!1),this.serverOrAttachTunnel(u,U,F)}async installTunnelService(r){let a;try{a=await this.runCodeTunnelCommand("serviceInstall",["service","install",...r])}catch(E){this._logger.error(E),a=1}if(a!==0){const E=(0,w.localize)(4,null);return this._logger.warn(E),this.setTunnelStatus(I.TunnelStates.connecting(E)),!1}return!0}async serverOrAttachTunnel(r,a,E){a.push("--parent-process-id",String(process.pid)),this._preventSleep()&&a.push("--no-sleep");let v=!1;const u=this.runCodeTunnelCommand("tunnel",a,(C,U)=>{U?this._logger.error(C):this._logger.info(C),C.includes("Connected to an existing tunnel process")&&(v=!0);const F=C.match(/Open this link in your browser (https:\/\/([^\/\s]+)\/([^\/\s]+)\/([^\/\s]+))/);if(F){const M={link:F[1],domain:F[2],tunnelName:F[4],isAttached:v};this.setTunnelStatus(I.TunnelStates.connected(M,E))}else C.match(/error refreshing token/)&&(u.cancel(),this._onDidTokenFailedEmitter.fire(r),this.setTunnelStatus(I.TunnelStates.disconnected(r)))});this._tunnelProcess=u,u.finally(()=>{u===this._tunnelProcess&&(this._logger.info("tunnel process terminated"),this._tunnelProcess=void 0,this._mode=I.INACTIVE_TUNNEL_MODE,this.setTunnelStatus(I.TunnelStates.disconnected()))})}runCodeTunnelCommand(r,a,E=this.defaultOnOutput){return(0,g.createCancelablePromise)(v=>new Promise((u,C)=>{v.isCancellationRequested&&u(-1);let U;const F=["ignore","pipe","pipe"];if(v.onCancellationRequested(()=>{U&&(this._logger.info(`${r} terminating(${U.pid})`),U.kill())}),!this.environmentService.isBuilt)E(`Building tunnel CLI from sources and run
`,!1),E(`${r} Spawning: cargo run -- tunnel ${a.join(" ")}
`,!1),U=(0,S.spawn)("cargo",["run","--","tunnel",...a],{cwd:(0,b.join)(this.environmentService.appRoot,"cli"),stdio:F});else{E(`Running tunnel CLI
`,!1);const M=this.getTunnelCommandLocation();E(`${r} Spawning: ${M} tunnel ${a.join(" ")}
`,!1),U=(0,S.spawn)(M,["tunnel",...a],{cwd:(0,l.homedir)(),stdio:F})}U.stdout.pipe(new m.StreamSplitter(`
`)).on("data",M=>{if(U){const z=M.toString();E(z,!1)}}),U.stderr.pipe(new m.StreamSplitter(`
`)).on("data",M=>{if(U){const z=M.toString();E(z,!0)}}),U.on("exit",M=>{U&&(E(`${r} exit(${U.pid}): + ${M} `,!1),U=void 0,u(M||0))}),U.on("error",M=>{U&&(E(`${r} error(${U.pid}): + ${M} `,!0),U=void 0,C())})}))}async getTunnelName(){return this._getTunnelName()}_preventSleep(){return!!this.configurationService.getValue(I.CONFIGURATION_KEY_PREVENT_SLEEP)}_getTunnelName(){let r=this.configurationService.getValue(I.CONFIGURATION_KEY_HOST_NAME)||(0,l.hostname)();return r=r.replace(/^-+/g,"").replace(/[^\w-]/g,"").substring(0,20),r||void 0}_restoreMode(){try{const r=this.storageService.get(T,-1),a=this.storageService.getBoolean(t,-1,!1);if(r){const E=JSON.parse(r);if(E&&(0,c.isString)(E.accountLabel)&&(0,c.isString)(E.sessionId)&&(0,c.isString)(E.providerId))return{active:!0,session:E,asService:a};this._logger.error("Problems restoring session from storage, invalid format",E)}}catch(r){this._logger.error("Problems restoring session from storage",r)}return I.INACTIVE_TUNNEL_MODE}_storeMode(r){if(r.active){const a={providerId:r.session.providerId,sessionId:r.session.sessionId,accountLabel:r.session.accountLabel};this.storageService.store(T,JSON.stringify(a),-1,1),this.storageService.store(t,r.asService,-1,1)}else this.storageService.remove(T,-1),this.storageService.remove(t,-1)}};e.RemoteTunnelService=o,e.RemoteTunnelService=o=Ee([G(0,A.ITelemetryService),G(1,P.IProductService),G(2,_.INativeEnvironmentService),G(3,D.ILoggerService),G(4,h.ISharedProcessLifecycleService),G(5,f.IConfigurationService),G(6,d.IStorageService)],o);function n(i,r){return i&&r?i.sessionId===r.sessionId&&i.providerId===r.providerId&&i.token===r.token:i===r}const s=(i,r)=>i.active!==r.active?!1:i.active&&r.active?i.asService===r.asService&&n(i.session,r.session):!0}),define(ce[250],le([0,1,5,2,22,65,19,75,17]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteStorageService=void 0;class S extends k.AbstractStorageService{constructor(p,g,h,f){super(),this.initialWorkspace=p,this.initialProfiles=g,this.remoteService=h,this.environmentService=f,this.applicationStorageProfile=this.initialProfiles.defaultProfile,this.applicationStorage=this.createApplicationStorage(),this.profileStorageProfile=this.initialProfiles.currentProfile,this.profileStorageDisposables=this._register(new O.DisposableStore),this.profileStorage=this.createProfileStorage(this.profileStorageProfile),this.workspaceStorageId=this.initialWorkspace?.id,this.workspaceStorageDisposables=this._register(new O.DisposableStore),this.workspaceStorage=this.createWorkspaceStorage(this.initialWorkspace)}createApplicationStorage(){const p=this._register(new D.ApplicationStorageDatabaseClient(this.remoteService.getChannel("storage"))),g=this._register(new _.Storage(p));return this._register(g.onDidChangeStorage(h=>this.emitDidChangeValue(-1,h))),g}createProfileStorage(p){this.profileStorageDisposables.clear(),this.profileStorageProfile=p;let g;if((0,k.isProfileUsingDefaultStorage)(p))g=this.applicationStorage;else{const h=this.profileStorageDisposables.add(new D.ProfileStorageDatabaseClient(this.remoteService.getChannel("storage"),p));g=this.profileStorageDisposables.add(new _.Storage(h))}return this.profileStorageDisposables.add(g.onDidChangeStorage(h=>this.emitDidChangeValue(0,h))),g}createWorkspaceStorage(p){this.workspaceStorageDisposables.clear(),this.workspaceStorageId=p?.id;let g;if(p){const h=this.workspaceStorageDisposables.add(new D.WorkspaceStorageDatabaseClient(this.remoteService.getChannel("storage"),p));g=this.workspaceStorageDisposables.add(new _.Storage(h)),this.workspaceStorageDisposables.add(g.onDidChangeStorage(f=>this.emitDidChangeValue(1,f)))}return g}async doInitialize(){await I.Promises.settled([this.applicationStorage.init(),this.profileStorage.init(),this.workspaceStorage?.init()??Promise.resolve()])}getStorage(p){switch(p){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}getLogDetails(p){switch(p){case-1:return this.applicationStorageProfile.globalStorageHome.fsPath;case 0:return this.profileStorageProfile?.globalStorageHome.fsPath;default:return this.workspaceStorageId?`${(0,A.joinPath)(this.environmentService.workspaceStorageHome,this.workspaceStorageId,"state.vscdb").fsPath}`:void 0}}async close(){this.stopFlushWhenIdle(),this.emitWillSaveState(k.WillSaveStateReason.SHUTDOWN),await I.Promises.settled([this.applicationStorage.close(),this.profileStorage.close(),this.workspaceStorage?.close()??Promise.resolve()])}async switchToProfile(p){if(!this.canSwitchProfile(this.profileStorageProfile,p))return;const g=this.profileStorage,h=g.items;g!==this.applicationStorage&&await g.close(),this.profileStorage=this.createProfileStorage(p),await this.profileStorage.init(),this.switchData(h,this.profileStorage,0)}async switchToWorkspace(p,g){const h=this.workspaceStorage,f=h?.items??new Map;await h?.close(),this.workspaceStorage=this.createWorkspaceStorage(p),await this.workspaceStorage.init(),this.switchData(f,this.workspaceStorage,1)}hasScope(p){return(0,b.isUserDataProfile)(p)?this.profileStorageProfile.id===p.id:this.workspaceStorageId===p.id}}e.RemoteStorageService=S}),define(ce[251],le([0,1,3,2,17,94]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataProfilesService=e.RemoteUserDataProfilesServiceChannel=void 0;class k{constructor(S,P){this.service=S,this.getUriTransformer=P}listen(S,P){const p=this.getUriTransformer(S);switch(P){case"onDidChangeProfiles":return I.Event.map(this.service.onDidChangeProfiles,g=>({all:g.all.map(h=>(0,_.transformOutgoingURIs)({...h},p)),added:g.added.map(h=>(0,_.transformOutgoingURIs)({...h},p)),removed:g.removed.map(h=>(0,_.transformOutgoingURIs)({...h},p)),updated:g.updated.map(h=>(0,_.transformOutgoingURIs)({...h},p))}))}throw new Error(`Invalid listen ${P}`)}async call(S,P,p){const g=this.getUriTransformer(S);switch(P){case"createProfile":{const h=await this.service.createProfile(p[0],p[1],p[2]);return(0,_.transformOutgoingURIs)({...h},g)}case"updateProfile":{let h=(0,A.reviveProfile)((0,_.transformIncomingURIs)(p[0],g),this.service.profilesHome.scheme);return h=await this.service.updateProfile(h,p[1]),(0,_.transformOutgoingURIs)({...h},g)}case"removeProfile":{const h=(0,A.reviveProfile)((0,_.transformIncomingURIs)(p[0],g),this.service.profilesHome.scheme);return this.service.removeProfile(h)}}throw new Error(`Invalid call ${P}`)}}e.RemoteUserDataProfilesServiceChannel=k;class D extends O.Disposable{get defaultProfile(){return this.profiles[0]}get profiles(){return this._profiles}constructor(S,P,p){super(),this.profilesHome=P,this.channel=p,this._profiles=[],this._onDidChangeProfiles=this._register(new I.Emitter),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this.enabled=!0,this._profiles=S.map(g=>(0,A.reviveProfile)(g,this.profilesHome.scheme)),this._register(this.channel.listen("onDidChangeProfiles")(g=>{const h=g.added.map(l=>(0,A.reviveProfile)(l,this.profilesHome.scheme)),f=g.removed.map(l=>(0,A.reviveProfile)(l,this.profilesHome.scheme)),w=g.updated.map(l=>(0,A.reviveProfile)(l,this.profilesHome.scheme));this._profiles=g.all.map(l=>(0,A.reviveProfile)(l,this.profilesHome.scheme)),this._onDidChangeProfiles.fire({added:h,removed:f,updated:w,all:this.profiles})})),this.onDidResetWorkspaces=this.channel.listen("onDidResetWorkspaces")}setEnablement(S){this.enabled=S}isEnabled(){return this.enabled}async createNamedProfile(S,P,p){const g=await this.channel.call("createNamedProfile",[S,P,p]);return(0,A.reviveProfile)(g,this.profilesHome.scheme)}async createProfile(S,P,p,g){const h=await this.channel.call("createProfile",[S,P,p,g]);return(0,A.reviveProfile)(h,this.profilesHome.scheme)}async createTransientProfile(S){const P=await this.channel.call("createTransientProfile",[S]);return(0,A.reviveProfile)(P,this.profilesHome.scheme)}async setProfileForWorkspace(S,P){await this.channel.call("setProfileForWorkspace",[S,P])}removeProfile(S){return this.channel.call("removeProfile",[S])}async updateProfile(S,P){const p=await this.channel.call("updateProfile",[S,P]);return(0,A.reviveProfile)(p,this.profilesHome.scheme)}resetWorkspaces(){return this.channel.call("resetWorkspaces")}cleanUp(){return this.channel.call("cleanUp")}cleanUpTransientProfiles(){return this.channel.call("cleanUpTransientProfiles")}}e.UserDataProfilesService=D}),define(ce[58],le([0,1,2,65,4,19,3,75,17]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteUserDataProfileStorageService=e.AbstractUserDataProfileStorageService=e.IUserDataProfileStorageService=void 0,e.IUserDataProfileStorageService=(0,A.createDecorator)("IUserDataProfileStorageService");let S=class extends I.Disposable{constructor(h){super(),this.storageService=h}async readStorageData(h){return this.withProfileScopedStorageService(h,async f=>this.getItems(f))}async updateStorageData(h,f,w){return this.withProfileScopedStorageService(h,async l=>this.writeItems(l,f,w))}async withProfileScopedStorageService(h,f){if(this.storageService.hasScope(h))return f(this.storageService);const w=await this.createStorageDatabase(h),l=new p(w);try{await l.initialize();const d=await f(l);return await l.flush(),d}finally{l.dispose(),await this.closeAndDispose(w)}}getItems(h){const f=new Map,w=l=>{for(const d of h.keys(0,l))f.set(d,{value:h.get(d,0),target:l})};return w(0),w(1),f}writeItems(h,f,w){h.storeAll(Array.from(f.entries()).map(([l,d])=>({key:l,value:d,scope:0,target:w})),!0)}async closeAndDispose(h){try{await h.close()}finally{(0,I.isDisposable)(h)&&h.dispose()}}};e.AbstractUserDataProfileStorageService=S,e.AbstractUserDataProfileStorageService=S=Ee([G(0,_.IStorageService)],S);class P extends S{constructor(h,f,w,l){super(w),this.remoteService=h;const d=h.getChannel("profileStorageListener"),c=this._register(new I.MutableDisposable);this._onDidChange=this._register(new k.Emitter({onWillAddFirstListener:()=>{c.value=d.listen("onDidChange")(m=>{l.trace("profile storage changes",m),this._onDidChange.fire({targetChanges:m.targetChanges.map(y=>(0,b.reviveProfile)(y,f.profilesHome.scheme)),valueChanges:m.valueChanges.map(y=>({...y,profile:(0,b.reviveProfile)(y.profile,f.profilesHome.scheme)}))})})},onDidRemoveLastListener:()=>c.value=void 0})),this.onDidChange=this._onDidChange.event}async createStorageDatabase(h){const f=this.remoteService.getChannel("storage");return(0,_.isProfileUsingDefaultStorage)(h)?new D.ApplicationStorageDatabaseClient(f):new D.ProfileStorageDatabaseClient(f,h)}}e.RemoteUserDataProfileStorageService=P;class p extends _.AbstractStorageService{constructor(h){super({flushInterval:100}),this.profileStorage=this._register(new O.Storage(h))}doInitialize(){return this.profileStorage.init()}getStorage(h){return h===0?this.profileStorage:void 0}getLogDetails(){}async switchToProfile(){}async switchToWorkspace(){}hasScope(){return!1}}}),define(ce[252],le([0,1,19,7,17,70,58]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NativeUserDataProfileStorageService=void 0;let D=class extends k.RemoteUserDataProfileStorageService{constructor(S,P,p,g){super(S,P,p,g)}};e.NativeUserDataProfileStorageService=D,e.NativeUserDataProfileStorageService=D=Ee([G(0,_.IMainProcessService),G(1,A.IUserDataProfilesService),G(2,I.IStorageService),G(3,O.ILogService)],D)}),define(ce[39],le([0,1,20,5,14,25,3,34,2,28,12,170,18,15,13,7,45,19,21,27,24,17]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractInitializer=e.AbstractJsonFileSynchroniser=e.AbstractFileSynchroniser=e.AbstractSynchroniser=e.getSyncResourceLogLabel=e.isSyncData=e.isRemoteUserData=void 0;function t(E){return!!(E&&E.ref!==void 0&&typeof E.ref=="string"&&E.ref!==""&&E.syncData!==void 0&&(E.syncData===null||o(E.syncData)))}e.isRemoteUserData=t;function o(E){return!!(E&&E.version!==void 0&&typeof E.version=="number"&&E.content!==void 0&&typeof E.content=="string"&&(Object.keys(E).length===2||Object.keys(E).length===3&&E.machineId!==void 0&&typeof E.machineId=="string"))}e.isSyncData=o;function n(E,v){return`${(0,S.uppercaseFirstLetter)(E)}${v.isDefault?"":` (${v.name})`}`}e.getSyncResourceLogLabel=n;let s=class extends b.Disposable{get status(){return this._status}get conflicts(){return{...this.syncResource,conflicts:this._conflicts}}constructor(v,u,C,U,F,M,z,V,J,H,Y,B){super(),this.syncResource=v,this.collection=u,this.fileService=C,this.environmentService=U,this.storageService=F,this.userDataSyncStoreService=M,this.userDataSyncBackupStoreService=z,this.userDataSyncEnablementService=V,this.telemetryService=J,this.logService=H,this.configurationService=Y,this.syncPreviewPromise=null,this._status="idle",this._onDidChangStatus=this._register(new k.Emitter),this.onDidChangeStatus=this._onDidChangStatus.event,this._conflicts=[],this._onDidChangeConflicts=this._register(new k.Emitter),this.onDidChangeConflicts=this._onDidChangeConflicts.event,this.localChangeTriggerThrottler=new O.ThrottledDelayer(50),this._onDidChangeLocal=this._register(new k.Emitter),this.onDidChangeLocal=this._onDidChangeLocal.event,this.lastSyncUserDataStateKey=`${this.collection?`${this.collection}.`:""}${this.syncResource.syncResource}.lastSyncUserData`,this.hasSyncResourceStateVersionChanged=!1,this.syncHeaders={},this.resource=this.syncResource.syncResource,this.syncResourceLogLabel=n(v.syncResource,v.profile),this.extUri=B.extUri,this.syncFolder=this.extUri.joinPath(U.userDataSyncHome,...(0,y.getPathSegments)(v.profile.isDefault?void 0:v.profile.id,v.syncResource)),this.syncPreviewFolder=this.extUri.joinPath(this.syncFolder,y.PREVIEW_DIR_NAME),this.lastSyncResource=(0,y.getLastSyncResourceUri)(v.profile.isDefault?void 0:v.profile.id,v.syncResource,U,this.extUri),this.currentMachineIdPromise=(0,l.getServiceMachineId)(U,C,F)}triggerLocalChange(){this.localChangeTriggerThrottler.trigger(()=>this.doTriggerLocalChange())}async doTriggerLocalChange(){if(this.status==="hasConflicts"){this.logService.info(`${this.syncResourceLogLabel}: In conflicts state and local change detected. Syncing again...`);const v=await this.syncPreviewPromise;this.syncPreviewPromise=null;const u=await this.performSync(v.remoteUserData,v.lastSyncUserData,!0,this.getUserDataSyncConfiguration());this.setStatus(u)}else{this.logService.trace(`${this.syncResourceLogLabel}: Checking for local changes...`);const v=await this.getLastSyncUserData();(v?await this.hasRemoteChanged(v):!0)&&this._onDidChangeLocal.fire()}}setStatus(v){this._status!==v&&(this._status=v,this._onDidChangStatus.fire(v))}async sync(v,u={}){await this._sync(v,!0,this.getUserDataSyncConfiguration(),u)}async preview(v,u,C={}){return this._sync(v,!1,u,C)}async apply(v,u={}){try{this.syncHeaders={...u};const C=await this.doApply(v);return this.setStatus(C),this.syncPreviewPromise}finally{this.syncHeaders={}}}async _sync(v,u,C,U){try{if(this.syncHeaders={...U},this.status==="hasConflicts")return this.logService.info(`${this.syncResourceLogLabel}: Skipped synchronizing ${this.resource.toLowerCase()} as there are conflicts.`),this.syncPreviewPromise;if(this.status==="syncing")return this.logService.info(`${this.syncResourceLogLabel}: Skipped synchronizing ${this.resource.toLowerCase()} as it is running already.`),this.syncPreviewPromise;this.logService.trace(`${this.syncResourceLogLabel}: Started synchronizing ${this.resource.toLowerCase()}...`),this.setStatus("syncing");let F="idle";try{const M=await this.getLastSyncUserData(),z=await this.getLatestRemoteUserData(v,M);return F=await this.performSync(z,M,u,C),F==="hasConflicts"?this.logService.info(`${this.syncResourceLogLabel}: Detected conflicts while synchronizing ${this.resource.toLowerCase()}.`):F==="idle"&&this.logService.trace(`${this.syncResourceLogLabel}: Finished synchronizing ${this.resource.toLowerCase()}.`),this.syncPreviewPromise||null}finally{this.setStatus(F)}}finally{this.syncHeaders={}}}async replace(v){const u=this.parseSyncData(v);if(!u)return!1;await this.stop();try{this.logService.trace(`${this.syncResourceLogLabel}: Started resetting ${this.resource.toLowerCase()}...`),this.setStatus("syncing");const C=await this.getLastSyncUserData(),U=await this.getLatestRemoteUserData(null,C),F=await this.isRemoteDataFromCurrentMachine(U),M=await this.generateSyncPreview({ref:U.ref,syncData:u},C,F,this.getUserDataSyncConfiguration(),_.CancellationToken.None),z=[];for(const V of M){const J=await this.getAcceptResult(V,V.remoteResource,void 0,_.CancellationToken.None),{remoteChange:H}=await this.getAcceptResult(V,V.previewResource,V.remoteContent,_.CancellationToken.None);z.push([V,{...J,remoteChange:H!==0?H:2}])}await this.applyResult(U,C,z,!1),this.logService.info(`${this.syncResourceLogLabel}: Finished resetting ${this.resource.toLowerCase()}.`)}finally{this.setStatus("idle")}return!0}async isRemoteDataFromCurrentMachine(v){const u=await this.currentMachineIdPromise;return!!v.syncData?.machineId&&v.syncData.machineId===u}async getLatestRemoteUserData(v,u){if(u){const C=v?v[this.resource]:void 0;if(u.ref===C||C===void 0&&u.syncData===null)return u}return this.getRemoteUserData(u)}async performSync(v,u,C,U){if(v.syncData&&v.syncData.version>this.version)throw this.telemetryService.publicLog2("sync/incompatible",{source:this.resource}),new y.UserDataSyncError((0,p.localize)(0,null,this.resource,this.version,v.syncData.version),"IncompatibleLocalContent",this.resource);try{return await this.doSync(v,u,C,U)}catch(F){if(F instanceof y.UserDataSyncError)switch(F.code){case"LocalPreconditionFailed":return this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize ${this.syncResourceLogLabel} as there is a new local version available. Synchronizing again...`),this.performSync(v,u,C,U);case"Conflict":case"PreconditionFailed":return this.logService.info(`${this.syncResourceLogLabel}: Failed to synchronize as there is a new remote version available. Synchronizing again...`),v=await this.getRemoteUserData(null),u=await this.getLastSyncUserData(),this.performSync(v,u,C,U)}throw F}}async doSync(v,u,C,U){try{const F=await this.isRemoteDataFromCurrentMachine(v),M=!F&&u===null&&this.getStoredLastSyncUserDataStateContent()!==void 0,z=C&&!M;this.syncPreviewPromise||(this.syncPreviewPromise=(0,O.createCancelablePromise)(J=>this.doGenerateSyncResourcePreview(v,u,F,z,U,J)));let V=await this.syncPreviewPromise;if(C&&M){this.logService.info(`${this.syncResourceLogLabel}: Accepting remote because it was synced before and the last sync data is not available.`);for(const J of V.resourcePreviews)V=await this.accept(J.remoteResource)||V}return this.updateConflicts(V.resourcePreviews),V.resourcePreviews.some(({mergeState:J})=>J==="conflict")?"hasConflicts":C?await this.doApply(!1):"syncing"}catch(F){throw this.syncPreviewPromise=null,F}}async merge(v){return await this.updateSyncResourcePreview(v,async u=>{const C=await this.getMergeResult(u,_.CancellationToken.None);await this.fileService.writeFile(u.previewResource,A.VSBuffer.fromString(C?.content||""));const U=C&&!C.hasConflicts?await this.getAcceptResult(u,u.previewResource,void 0,_.CancellationToken.None):void 0;return u.acceptResult=U,u.mergeState=C.hasConflicts?"conflict":U?"accepted":"preview",u.localChange=U?U.localChange:C.localChange,u.remoteChange=U?U.remoteChange:C.remoteChange,u}),this.syncPreviewPromise}async accept(v,u){return await this.updateSyncResourcePreview(v,async C=>{const U=await this.getAcceptResult(C,v,u,_.CancellationToken.None);return C.acceptResult=U,C.mergeState="accepted",C.localChange=U.localChange,C.remoteChange=U.remoteChange,C}),this.syncPreviewPromise}async discard(v){return await this.updateSyncResourcePreview(v,async u=>{const C=await this.getMergeResult(u,_.CancellationToken.None);return await this.fileService.writeFile(u.previewResource,A.VSBuffer.fromString(C.content||"")),u.acceptResult=void 0,u.mergeState="preview",u.localChange=C.localChange,u.remoteChange=C.remoteChange,u}),this.syncPreviewPromise}async updateSyncResourcePreview(v,u){if(!this.syncPreviewPromise)return;let C=await this.syncPreviewPromise;const U=C.resourcePreviews.findIndex(({localResource:F,remoteResource:M,previewResource:z})=>this.extUri.isEqual(F,v)||this.extUri.isEqual(M,v)||this.extUri.isEqual(z,v));U!==-1&&(this.syncPreviewPromise=(0,O.createCancelablePromise)(async F=>{const M=[...C.resourcePreviews];return M[U]=await u(M[U]),{...C,resourcePreviews:M}}),C=await this.syncPreviewPromise,this.updateConflicts(C.resourcePreviews),C.resourcePreviews.some(({mergeState:F})=>F==="conflict")?this.setStatus("hasConflicts"):this.setStatus("syncing"))}async doApply(v){if(!this.syncPreviewPromise)return"idle";const u=await this.syncPreviewPromise;return u.resourcePreviews.some(({mergeState:C})=>C==="conflict")?"hasConflicts":u.resourcePreviews.some(({mergeState:C})=>C!=="accepted")?"syncing":(await this.applyResult(u.remoteUserData,u.lastSyncUserData,u.resourcePreviews.map(C=>[C,C.acceptResult]),v),this.syncPreviewPromise=null,await this.clearPreviewFolder(),"idle")}async clearPreviewFolder(){try{await this.fileService.del(this.syncPreviewFolder,{recursive:!0})}catch{}}updateConflicts(v){const u=v.filter(({mergeState:C})=>C==="conflict");(0,I.equals)(this._conflicts,u,(C,U)=>this.extUri.isEqual(C.previewResource,U.previewResource))||(this._conflicts=u,this._onDidChangeConflicts.fire(this.conflicts))}async hasPreviouslySynced(){const v=await this.getLastSyncUserData();return!!v&&v.syncData!==null}async resolvePreviewContent(v){const u=this.syncPreviewPromise?await this.syncPreviewPromise:null;if(u)for(const C of u.resourcePreviews){if(this.extUri.isEqual(C.acceptedResource,v))return C.acceptResult?C.acceptResult.content:null;if(this.extUri.isEqual(C.remoteResource,v))return C.remoteContent;if(this.extUri.isEqual(C.localResource,v))return C.localContent;if(this.extUri.isEqual(C.baseResource,v))return C.baseContent}return null}async resetLocal(){this.storageService.remove(this.lastSyncUserDataStateKey,-1);try{await this.fileService.del(this.lastSyncResource)}catch(v){(0,f.toFileOperationResult)(v)!==1&&this.logService.error(v)}}async doGenerateSyncResourcePreview(v,u,C,U,F,M){const z=await this.generateSyncPreview(v,u,C,F,M),V=[];for(const J of z){const H=J.previewResource.with({scheme:y.USER_DATA_SYNC_SCHEME,authority:"accepted"});if(J.localChange===0&&J.remoteChange===0)V.push({...J,acceptedResource:H,acceptResult:{content:null,localChange:0,remoteChange:0},mergeState:"accepted"});else{const Y=U?await this.getMergeResult(J,M):void 0;if(M.isCancellationRequested)break;await this.fileService.writeFile(J.previewResource,A.VSBuffer.fromString(Y?.content||""));const B=Y&&!Y.hasConflicts?await this.getAcceptResult(J,J.previewResource,void 0,M):void 0;V.push({...J,acceptResult:B,mergeState:Y?.hasConflicts?"conflict":B?"accepted":"preview",localChange:B?B.localChange:Y?Y.localChange:J.localChange,remoteChange:B?B.remoteChange:Y?Y.remoteChange:J.remoteChange})}}return{syncResource:this.resource,profile:this.syncResource.profile,remoteUserData:v,lastSyncUserData:u,resourcePreviews:V,isLastSyncFromCurrentMachine:C}}async getLastSyncUserData(){let v=this.getStoredLastSyncUserDataStateContent();if(v||(v=await this.migrateLastSyncUserData()),!v)return this.logService.info(`${this.syncResourceLogLabel}: Last sync data state does not exist.`),null;const u=JSON.parse(v),C=this.userDataSyncEnablementService.getResourceSyncStateVersion(this.resource);if(this.hasSyncResourceStateVersionChanged=!!u.version&&!!C&&u.version!==C,this.hasSyncResourceStateVersionChanged)return this.logService.info(`${this.syncResourceLogLabel}: Reset last sync state because last sync state version ${u.version} is not compatible with current sync state version ${C}.`),await this.resetLocal(),null;let U,F=1;for(;U===void 0&&F++<6;)try{const M=await this.readLastSyncStoredRemoteUserData();M&&(M.ref===u.ref?U=M.syncData:this.logService.info(`${this.syncResourceLogLabel}: Last sync data stored locally is not same as the last sync state.`));break}catch(M){if(M instanceof f.FileOperationError&&M.fileOperationResult===1){this.logService.info(`${this.syncResourceLogLabel}: Last sync resource does not exist locally.`);break}else{if(M instanceof y.UserDataSyncError)throw M;this.logService.error(M,F)}}if(U===void 0)try{const M=await this.userDataSyncStoreService.resolveResourceContent(this.resource,u.ref,this.collection,this.syncHeaders);U=M===null?null:this.parseSyncData(M),await this.writeLastSyncStoredRemoteUserData({ref:u.ref,syncData:U})}catch(M){if(M instanceof y.UserDataSyncError&&M.code==="NotFound")this.logService.info(`${this.syncResourceLogLabel}: Last sync resource does not exist remotely.`);else throw M}return U===void 0?null:{...u,syncData:U}}async updateLastSyncUserData(v,u={}){if(u.ref||u.version)throw new Error("Cannot have core properties as additional");const C=this.userDataSyncEnablementService.getResourceSyncStateVersion(this.resource),U={ref:v.ref,version:C,...u};this.storageService.store(this.lastSyncUserDataStateKey,JSON.stringify(U),-1,1),await this.writeLastSyncStoredRemoteUserData(v)}getStoredLastSyncUserDataStateContent(){return this.storageService.get(this.lastSyncUserDataStateKey,-1)}async readLastSyncStoredRemoteUserData(){const v=(await this.fileService.readFile(this.lastSyncResource)).value.toString();try{const u=v?JSON.parse(v):void 0;if(t(u))return u}catch(u){this.logService.error(u)}}async writeLastSyncStoredRemoteUserData(v){await this.fileService.writeFile(this.lastSyncResource,A.VSBuffer.fromString(JSON.stringify(v)))}async migrateLastSyncUserData(){try{const v=await this.fileService.readFile(this.lastSyncResource),u=JSON.parse(v.value.toString());await this.fileService.del(this.lastSyncResource),u.ref&&u.content!==void 0?(this.storageService.store(this.lastSyncUserDataStateKey,JSON.stringify({...u,content:void 0}),-1,1),await this.writeLastSyncStoredRemoteUserData({ref:u.ref,syncData:u.content===null?null:JSON.parse(u.content)})):this.logService.info(`${this.syncResourceLogLabel}: Migrating last sync user data. Invalid data.`,u)}catch(v){v instanceof f.FileOperationError&&v.fileOperationResult===1?this.logService.info(`${this.syncResourceLogLabel}: Migrating last sync user data. Resource does not exist.`):this.logService.error(v)}return this.storageService.get(this.lastSyncUserDataStateKey,-1)}async getRemoteUserData(v){const{ref:u,content:C}=await this.getUserData(v);let U=null;return C!==null&&(U=this.parseSyncData(C)),{ref:u,syncData:U}}parseSyncData(v){try{const u=JSON.parse(v);if(o(u))return u}catch(u){this.logService.error(u)}throw new y.UserDataSyncError((0,p.localize)(1,null),"IncompatibleRemoteContent",this.resource)}async getUserData(v){const u=v?{ref:v.ref,content:v.syncData?JSON.stringify(v.syncData):null}:null;return this.userDataSyncStoreService.readResource(this.resource,u,this.collection,this.syncHeaders)}async updateRemoteUserData(v,u){const C=await this.currentMachineIdPromise,U={version:this.version,machineId:C,content:v};try{return u=await this.userDataSyncStoreService.writeResource(this.resource,JSON.stringify(U),u,this.collection,this.syncHeaders),{ref:u,syncData:U}}catch(F){throw F instanceof y.UserDataSyncError&&F.code==="TooLarge"&&(F=new y.UserDataSyncError(F.message,F.code,this.resource)),F}}async backupLocal(v){const u={version:this.version,content:v};return this.userDataSyncBackupStoreService.backup(this.syncResource.profile,this.resource,JSON.stringify(u))}async stop(){this.status!=="idle"&&(this.logService.trace(`${this.syncResourceLogLabel}: Stopping synchronizing ${this.resource.toLowerCase()}.`),this.syncPreviewPromise&&(this.syncPreviewPromise.cancel(),this.syncPreviewPromise=null),this.updateConflicts([]),await this.clearPreviewFolder(),this.setStatus("idle"),this.logService.info(`${this.syncResourceLogLabel}: Stopped synchronizing ${this.resource.toLowerCase()}.`))}getUserDataSyncConfiguration(){return this.configurationService.getValue(y.USER_DATA_SYNC_CONFIGURATION_SCOPE)}};e.AbstractSynchroniser=s,e.AbstractSynchroniser=s=Ee([G(2,f.IFileService),G(3,h.IEnvironmentService),G(4,d.IStorageService),G(5,y.IUserDataSyncStoreService),G(6,y.IUserDataSyncBackupStoreService),G(7,y.IUserDataSyncEnablementService),G(8,c.ITelemetryService),G(9,y.IUserDataSyncLogService),G(10,g.IConfigurationService),G(11,m.IUriIdentityService)],s);let i=class extends s{constructor(v,u,C,U,F,M,z,V,J,H,Y,B,K){super(u,C,U,F,M,z,V,J,H,Y,B,K),this.file=v,this._register(this.fileService.watch(this.extUri.dirname(v))),this._register(this.fileService.onDidFilesChange(x=>this.onFileChanges(x)))}async getLocalFileContent(){try{return await this.fileService.readFile(this.file)}catch{return null}}async updateLocalFileContent(v,u,C){try{u?await this.fileService.writeFile(this.file,A.VSBuffer.fromString(v),C?void 0:u):await this.fileService.createFile(this.file,A.VSBuffer.fromString(v),{overwrite:C})}catch(U){throw U instanceof f.FileOperationError&&U.fileOperationResult===1||U instanceof f.FileOperationError&&U.fileOperationResult===3?new y.UserDataSyncError(U.message,"LocalPreconditionFailed"):U}}async deleteLocalFile(){try{await this.fileService.del(this.file)}catch(v){if(!(v instanceof f.FileOperationError&&v.fileOperationResult===1))throw v}}onFileChanges(v){v.contains(this.file)&&this.triggerLocalChange()}};e.AbstractFileSynchroniser=i,e.AbstractFileSynchroniser=i=Ee([G(3,f.IFileService),G(4,h.IEnvironmentService),G(5,d.IStorageService),G(6,y.IUserDataSyncStoreService),G(7,y.IUserDataSyncBackupStoreService),G(8,y.IUserDataSyncEnablementService),G(9,c.ITelemetryService),G(10,y.IUserDataSyncLogService),G(11,g.IConfigurationService),G(12,m.IUriIdentityService)],i);let r=class extends i{constructor(v,u,C,U,F,M,z,V,J,H,Y,B,K,x){super(v,u,C,U,F,M,z,V,J,H,Y,K,x),this.userDataSyncUtilService=B,this._formattingOptions=void 0}hasErrors(v,u){const C=[],U=(0,D.parse)(v,C,{allowEmptyContent:!0,allowTrailingComma:!0});return C.length>0||!(0,P.isUndefined)(U)&&u!==Array.isArray(U)}getFormattingOptions(){return this._formattingOptions||(this._formattingOptions=this.userDataSyncUtilService.resolveFormattingOptions(this.file)),this._formattingOptions}};e.AbstractJsonFileSynchroniser=r,e.AbstractJsonFileSynchroniser=r=Ee([G(3,f.IFileService),G(4,h.IEnvironmentService),G(5,d.IStorageService),G(6,y.IUserDataSyncStoreService),G(7,y.IUserDataSyncBackupStoreService),G(8,y.IUserDataSyncEnablementService),G(9,c.ITelemetryService),G(10,y.IUserDataSyncLogService),G(11,y.IUserDataSyncUtilService),G(12,g.IConfigurationService),G(13,m.IUriIdentityService)],r);let a=class{constructor(v,u,C,U,F,M,z){this.resource=v,this.userDataProfilesService=u,this.environmentService=C,this.logService=U,this.fileService=F,this.storageService=M,this.extUri=z.extUri,this.lastSyncResource=(0,y.getLastSyncResourceUri)(void 0,this.resource,C,this.extUri)}async initialize({ref:v,content:u}){if(!u){this.logService.info("Remote content does not exist.",this.resource);return}const C=this.parseSyncData(u);if(C)try{await this.doInitialize({ref:v,syncData:C})}catch(U){this.logService.error(U)}}parseSyncData(v){try{const u=JSON.parse(v);if(o(u))return u}catch(u){this.logService.error(u)}this.logService.info("Cannot parse sync data as it is not compatible with the current version.",this.resource)}async updateLastSyncUserData(v,u={}){if(u.ref||u.version)throw new Error("Cannot have core properties as additional");const C={ref:v.ref,version:void 0,...u};this.storageService.store(`${this.resource}.lastSyncUserData`,JSON.stringify(C),-1,1),await this.fileService.writeFile(this.lastSyncResource,A.VSBuffer.fromString(JSON.stringify(v)))}};e.AbstractInitializer=a,e.AbstractInitializer=a=Ee([G(1,T.IUserDataProfilesService),G(2,h.IEnvironmentService),G(3,w.ILogService),G(4,f.IFileService),G(5,d.IStorageService),G(6,m.IUriIdentityService)],a)}),define(ce[116],le([0,1,5,25,8,3,42,2,28,18,15,115,29,33,80,41,13,4,69,7,19,21,27,17,39,232,112,24,58]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o,n,s,i,r,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractExtensionsInitializer=e.LocalExtensionsProvider=e.ExtensionsSynchroniser=e.stringify=e.parseExtensions=void 0;async function E(M,z){const V=JSON.parse(M.content);if(M.version===1||M.version===2){const J=(await z.getInstalled(0)).filter(H=>H.isBuiltin);for(const H of V)M.version===1&&(H.enabled===!1&&(H.disabled=!0),delete H.enabled),M.version===2&&J.every(Y=>!(0,h.areSameExtensions)(Y.identifier,H.identifier))&&(H.installed=!0)}return V}function v(M){return JSON.parse(M.content)}e.parseExtensions=v;function u(M,z){return M.sort((V,J)=>!V.identifier.uuid&&J.identifier.uuid?-1:V.identifier.uuid&&!J.identifier.uuid?1:(0,b.compare)(V.identifier.id,J.identifier.id)),z?(0,k.toFormattedString)(M,{}):JSON.stringify(M)}e.stringify=u;let C=class extends n.AbstractSynchroniser{constructor(z,V,J,H,Y,B,K,x,q,j,Z,oe,ue,ae,$,R,L){super({syncResource:"extensions",profile:z},V,H,J,Y,B,K,oe,ue,j,Z,$),this.extensionManagementService=x,this.ignoredExtensionsManagementService=q,this.instantiationService=L,this.version=6,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"extensions.json"),this.baseResource=this.previewResource.with({scheme:r.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:r.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:r.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:r.USER_DATA_SYNC_SCHEME,authority:"accepted"}),this.localExtensionsProvider=this.instantiationService.createInstance(U),this._register(_.Event.any(_.Event.filter(this.extensionManagementService.onDidInstallExtensions,N=>N.some(({local:W})=>!!W)),_.Event.filter(this.extensionManagementService.onDidUninstallExtension,N=>!N.error),_.Event.filter(R.onDidChange,N=>N.valueChanges.some(({profile:W,changes:X})=>this.syncResource.profile.id===W.id&&X.some(ne=>ne.key===g.DISABLED_EXTENSIONS_STORAGE_PATH))),ae.onDidChangeExtensionStorageToSync)(()=>this.triggerLocalChange()))}async generateSyncPreview(z,V){const J=z.syncData?await E(z.syncData,this.extensionManagementService):null,H=V?.skippedExtensions??[],Y=V?.builtinExtensions??null,B=V?.syncData?await E(V.syncData,this.extensionManagementService):null,{localExtensions:K,ignoredExtensions:x}=await this.localExtensionsProvider.getLocalExtensions(this.syncResource.profile);J?this.logService.trace(`${this.syncResourceLogLabel}: Merging remote extensions with local extensions...`):this.logService.trace(`${this.syncResourceLogLabel}: Remote extensions does not exist. Synchronizing extensions for the first time.`);const{local:q,remote:j}=(0,s.merge)(K,J,B,H,x,Y),Z={local:q,remote:j,content:this.getPreviewContent(K,q.added,q.updated,q.removed),localChange:q.added.length>0||q.removed.length>0||q.updated.length>0?2:0,remoteChange:j!==null?2:0},oe=this.stringify(K,!1);return[{skippedExtensions:H,builtinExtensions:Y,baseResource:this.baseResource,baseContent:B?this.stringify(B,!1):oe,localResource:this.localResource,localContent:oe,localExtensions:K,remoteResource:this.remoteResource,remoteExtensions:J,remoteContent:J?this.stringify(J,!1):null,previewResource:this.previewResource,previewResult:Z,localChange:Z.localChange,remoteChange:Z.remoteChange,acceptedResource:this.acceptedResource}]}async hasRemoteChanged(z){const V=z.syncData?await E(z.syncData,this.extensionManagementService):null,{localExtensions:J,ignoredExtensions:H}=await this.localExtensionsProvider.getLocalExtensions(this.syncResource.profile),{remote:Y}=(0,s.merge)(J,V,V,z.skippedExtensions||[],H,z.builtinExtensions||[]);return Y!==null}getPreviewContent(z,V,J,H){const Y=[...V,...J],B=new Set,K=x=>{B.add(x.id.toLowerCase()),x.uuid&&B.add(x.uuid)};Y.forEach(({identifier:x})=>K(x)),H.forEach(K);for(const x of z)B.has(x.identifier.id.toLowerCase())||x.identifier.uuid&&B.has(x.identifier.uuid)||Y.push(x);return this.stringify(Y,!1)}async getMergeResult(z,V){return{...z.previewResult,hasConflicts:!1}}async getAcceptResult(z,V,J,H){if(this.extUri.isEqual(V,this.localResource))return this.acceptLocal(z);if(this.extUri.isEqual(V,this.remoteResource))return this.acceptRemote(z);if(this.extUri.isEqual(V,this.previewResource))return z.previewResult;throw new Error(`Invalid Resource: ${V.toString()}`)}async acceptLocal(z){const V=await this.extensionManagementService.getInstalled(void 0,this.syncResource.profile.extensionsResource),J=this.ignoredExtensionsManagementService.getIgnoredExtensions(V),H=(0,s.merge)(z.localExtensions,null,null,z.skippedExtensions,J,z.builtinExtensions),{local:Y,remote:B}=H;return{content:z.localContent,local:Y,remote:B,localChange:Y.added.length>0||Y.removed.length>0||Y.updated.length>0?2:0,remoteChange:B!==null?2:0}}async acceptRemote(z){const V=await this.extensionManagementService.getInstalled(void 0,this.syncResource.profile.extensionsResource),J=this.ignoredExtensionsManagementService.getIgnoredExtensions(V),H=z.remoteContent?JSON.parse(z.remoteContent):null;if(H!==null){const Y=(0,s.merge)(z.localExtensions,H,z.localExtensions,[],J,z.builtinExtensions),{local:B,remote:K}=Y;return{content:z.remoteContent,local:B,remote:K,localChange:B.added.length>0||B.removed.length>0||B.updated.length>0?2:0,remoteChange:K!==null?2:0}}else return{content:z.remoteContent,local:{added:[],removed:[],updated:[]},remote:null,localChange:0,remoteChange:0}}async applyResult(z,V,J,H){let{skippedExtensions:Y,builtinExtensions:B,localExtensions:K}=J[0][0];const{local:x,remote:q,localChange:j,remoteChange:Z}=J[0][1];if(j===0&&Z===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing extensions.`),j!==0&&(await this.backupLocal(JSON.stringify(K)),Y=await this.localExtensionsProvider.updateLocalExtensions(x.added,x.removed,x.updated,Y,this.syncResource.profile)),q){this.logService.trace(`${this.syncResourceLogLabel}: Updating remote extensions...`);const oe=JSON.stringify(q.all);z=await this.updateRemoteUserData(oe,H?null:z.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote extensions.${q.added.length?` Added: ${JSON.stringify(q.added.map(ue=>ue.identifier.id))}.`:""}${q.updated.length?` Updated: ${JSON.stringify(q.updated.map(ue=>ue.identifier.id))}.`:""}${q.removed.length?` Removed: ${JSON.stringify(q.removed.map(ue=>ue.identifier.id))}.`:""}`)}V?.ref!==z.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized extensions...`),B=this.computeBuiltinExtensions(K,B),await this.updateLastSyncUserData(z,{skippedExtensions:Y,builtinExtensions:B}),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized extensions.${Y.length?` Skipped: ${JSON.stringify(Y.map(oe=>oe.identifier.id))}.`:""}`))}computeBuiltinExtensions(z,V){const J=new Set,H=[];for(const Y of z)J.add(Y.identifier.id.toLowerCase()),Y.installed||H.push(Y.identifier);if(V)for(const Y of V)J.has(Y.id.toLowerCase())||H.push(Y);return H}async resolveContent(z){if(this.extUri.isEqual(this.remoteResource,z)||this.extUri.isEqual(this.baseResource,z)||this.extUri.isEqual(this.localResource,z)||this.extUri.isEqual(this.acceptedResource,z)){const V=await this.resolvePreviewContent(z);return V&&this.stringify(JSON.parse(V),!0)}return null}stringify(z,V){return u(z,V)}async hasLocalData(){try{const{localExtensions:z}=await this.localExtensionsProvider.getLocalExtensions(this.syncResource.profile);if(z.some(V=>V.installed||V.disabled))return!0}catch{}return!1}};e.ExtensionsSynchroniser=C,e.ExtensionsSynchroniser=C=Ee([G(2,P.IEnvironmentService),G(3,l.IFileService),G(4,y.IStorageService),G(5,r.IUserDataSyncStoreService),G(6,r.IUserDataSyncBackupStoreService),G(7,g.IExtensionManagementService),G(8,i.IIgnoredExtensionsManagementService),G(9,r.IUserDataSyncLogService),G(10,S.IConfigurationService),G(11,r.IUserDataSyncEnablementService),G(12,T.ITelemetryService),G(13,f.IExtensionStorageService),G(14,t.IUriIdentityService),G(15,a.IUserDataProfileStorageService),G(16,d.IInstantiationService)],C);let U=class{constructor(z,V,J,H,Y,B){this.extensionManagementService=z,this.userDataProfileStorageService=V,this.extensionGalleryService=J,this.ignoredExtensionsManagementService=H,this.instantiationService=Y,this.logService=B}async getLocalExtensions(z){const V=await this.extensionManagementService.getInstalled(void 0,z.extensionsResource),J=this.ignoredExtensionsManagementService.getIgnoredExtensions(V);return{localExtensions:await this.withProfileScopedServices(z,async(Y,B)=>{const K=Y.getDisabledExtensions();return V.map(x=>{const{identifier:q,isBuiltin:j,manifest:Z,preRelease:oe,pinned:ue,isApplicationScoped:ae}=x,$={identifier:q,preRelease:oe,version:Z.version,pinned:!!ue};ae&&!(0,w.isApplicationScopedExtension)(Z)&&($.isApplicationScoped=ae),K.some(R=>(0,h.areSameExtensions)(R,q))&&($.disabled=!0),j||($.installed=!0);try{const R=B.getKeysForSync({id:q.id,version:Z.version});if(R){const L=B.getExtensionState(x,!0)||{};$.state=Object.keys(L).reduce((N,W)=>(R.includes(W)&&(N[W]=L[W]),N),{})}}catch(R){this.logService.info(`${(0,n.getSyncResourceLogLabel)("extensions",z)}: Error while parsing extension state`,(0,A.getErrorMessage)(R))}return $})}),ignoredExtensions:J}}async updateLocalExtensions(z,V,J,H,Y){const B=(0,n.getSyncResourceLogLabel)("extensions",Y),K=[],x=new Map,q=[],j=[],Z=await this.extensionManagementService.getInstalled(void 0,Y.extensionsResource);if((z.length||J.length)&&await this.withProfileScopedServices(Y,async(ae,$)=>{await I.Promises.settled([...z,...J].map(async R=>{const L=Z.find(X=>(0,h.areSameExtensions)(X.identifier,R.identifier));if(L&&L.isBuiltin){R.state&&L.manifest.version===R.version&&this.updateExtensionState(R.state,L,L.manifest.version,$),ae.getDisabledExtensions().some(ne=>(0,h.areSameExtensions)(ne,R.identifier))!==!!R.disabled&&(R.disabled?(this.logService.trace(`${B}: Disabling extension...`,R.identifier.id),await ae.disableExtension(R.identifier),this.logService.info(`${B}: Disabled extension`,R.identifier.id)):(this.logService.trace(`${B}: Enabling extension...`,R.identifier.id),await ae.enableExtension(R.identifier),this.logService.info(`${B}: Enabled extension`,R.identifier.id))),q.push(R.identifier);return}const N=R.pinned?R.version:void 0,W=(await this.extensionGalleryService.getExtensions([{...R.identifier,version:N,preRelease:N?void 0:R.preRelease}],O.CancellationToken.None))[0];if(R.state&&(L?L.manifest.version===R.version:W)&&this.updateExtensionState(R.state,L||W,L?.manifest.version,$),W)try{ae.getDisabledExtensions().some(ne=>(0,h.areSameExtensions)(ne,R.identifier))!==!!R.disabled&&(R.disabled?(this.logService.trace(`${B}: Disabling extension...`,R.identifier.id,W.version),await ae.disableExtension(W.identifier),this.logService.info(`${B}: Disabled extension`,R.identifier.id,W.version)):(this.logService.trace(`${B}: Enabling extension...`,R.identifier.id,W.version),await ae.enableExtension(W.identifier),this.logService.info(`${B}: Enabled extension`,R.identifier.id,W.version))),(!L||L.preRelease!==R.preRelease||L.pinned!==R.pinned||N&&L.manifest.version!==N)&&(await this.extensionManagementService.canInstall(W)?(K.push({extension:W,options:{isMachineScoped:!1,donotIncludePackAndDependencies:!0,installGivenVersion:R.pinned&&!!R.version,installPreReleaseVersion:R.preRelease,profileLocation:Y.extensionsResource,isApplicationScoped:R.isApplicationScoped,context:{[g.EXTENSION_INSTALL_SKIP_WALKTHROUGH_CONTEXT]:!0,[g.EXTENSION_INSTALL_SYNC_CONTEXT]:!0}}}),x.set(W.identifier.id.toLowerCase(),R)):(this.logService.info(`${B}: Skipped synchronizing extension because it cannot be installed.`,W.displayName||W.identifier.id),j.push(R)))}catch(X){j.push(R),this.logService.error(X),this.logService.info(`${B}: Skipped synchronizing extension`,W.displayName||W.identifier.id)}else j.push(R),this.logService.info(`${B}: Skipped synchronizing extension because the extension is not found.`,R.identifier.id)}))}),V.length){const ae=Z.filter(({identifier:$,isBuiltin:R})=>!R&&V.some(L=>(0,h.areSameExtensions)($,L)));await I.Promises.settled(ae.map(async $=>{this.logService.trace(`${B}: Uninstalling local extension...`,$.identifier.id),await this.extensionManagementService.uninstall($,{donotIncludePack:!0,donotCheckDependents:!0,profileLocation:Y.extensionsResource}),this.logService.info(`${B}: Uninstalled local extension.`,$.identifier.id),q.push($.identifier)}))}const oe=await this.extensionManagementService.installGalleryExtensions(K);for(const{identifier:ae,local:$,error:R,source:L}of oe){const N=L;if($)this.logService.info(`${B}: Installed extension.`,ae.id,N.version),q.push(ae);else{const W=x.get(ae.id.toLowerCase());W&&(j.push(W),this.logService.info(`${B}: Skipped synchronizing extension`,N.displayName||N.identifier.id)),R instanceof g.ExtensionManagementError&&[g.ExtensionManagementErrorCode.Incompatible,g.ExtensionManagementErrorCode.IncompatibleTargetPlatform].includes(R.code)?this.logService.info(`${B}: Skipped synchronizing extension because the compatible extension is not found.`,N.displayName||N.identifier.id):R&&this.logService.error(R)}}const ue=[];for(const ae of H)q.some($=>(0,h.areSameExtensions)($,ae.identifier))||ue.push(ae);for(const ae of j)ue.some($=>(0,h.areSameExtensions)($.identifier,ae.identifier))||ue.push(ae);return ue}updateExtensionState(z,V,J,H){const Y=H.getExtensionState(V,!0)||{},B=J?H.getKeysForSync({id:V.identifier.id,version:J}):void 0;B?B.forEach(K=>{Y[K]=z[K]}):Object.keys(z).forEach(K=>Y[K]=z[K]),H.setExtensionState(V,Y,!0)}async withProfileScopedServices(z,V){return this.userDataProfileStorageService.withProfileScopedStorageService(z,async J=>{const H=new D.DisposableStore,Y=this.instantiationService.createChild(new c.ServiceCollection([y.IStorageService,J])),B=H.add(Y.createInstance(p.GlobalExtensionEnablementService)),K=H.add(Y.createInstance(f.ExtensionStorageService));try{return await V(B,K)}finally{H.dispose()}})}};e.LocalExtensionsProvider=U,e.LocalExtensionsProvider=U=Ee([G(0,g.IExtensionManagementService),G(1,a.IUserDataProfileStorageService),G(2,g.IExtensionGalleryService),G(3,i.IIgnoredExtensionsManagementService),G(4,d.IInstantiationService),G(5,r.IUserDataSyncLogService)],U);let F=class extends n.AbstractInitializer{constructor(z,V,J,H,Y,B,K,x){super("extensions",H,Y,B,J,K,x),this.extensionManagementService=z,this.ignoredExtensionsManagementService=V}async parseExtensions(z){return z.syncData?await E(z.syncData,this.extensionManagementService):null}generatePreview(z,V){const J=[],H=[],Y=[];for(const B of z){if(this.ignoredExtensionsManagementService.hasToNeverSyncExtension(B.identifier.id))continue;const K=V.find(x=>(0,h.areSameExtensions)(x.identifier,B.identifier));K?(J.push(K),B.disabled&&Y.push(B.identifier)):B.installed&&(H.push({...B.identifier,preRelease:!!B.preRelease}),B.disabled&&Y.push(B.identifier))}return{installedExtensions:J,newExtensions:H,disabledExtensions:Y,remoteExtensions:z}}};e.AbstractExtensionsInitializer=F,e.AbstractExtensionsInitializer=F=Ee([G(0,g.IExtensionManagementService),G(1,i.IIgnoredExtensionsManagementService),G(2,l.IFileService),G(3,o.IUserDataProfilesService),G(4,P.IEnvironmentService),G(5,m.ILogService),G(6,y.IStorageService),G(7,t.IUriIdentityService)],F)}),define(ce[117],le([0,1,14,8,3,34,42,6,32,18,15,13,7,45,19,21,27,39,77,236,24,17,58,4]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncStoreTypeSynchronizer=e.GlobalStateInitializer=e.LocalGlobalStateProvider=e.GlobalStateSynchroniser=e.stringify=void 0;const n="globalState.argv.",s=["locale"];function i(C,U){const F=C.storage?Object.keys(C.storage).sort():[],M={};return F.forEach(z=>M[z]=C.storage[z]),C.storage=M,U?(0,k.toFormattedString)(C,{}):JSON.stringify(C)}e.stringify=i;const r=1;let a=class extends d.AbstractSynchroniser{constructor(U,F,M,z,V,J,H,Y,B,K,x,q,j,Z){super({syncResource:"globalState",profile:U},F,z,Y,q,V,J,B,K,H,x,j),this.userDataProfileStorageService=M,this.version=r,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"globalState.json"),this.baseResource=this.previewResource.with({scheme:y.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:y.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:y.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:y.USER_DATA_SYNC_SCHEME,authority:"accepted"}),this.localGlobalStateProvider=Z.createInstance(E),this._register(z.watch(this.extUri.dirname(this.environmentService.argvResource))),this._register(A.Event.any(A.Event.filter(z.onDidFilesChange,oe=>oe.contains(this.environmentService.argvResource)),A.Event.filter(M.onDidChange,oe=>!!(oe.targetChanges.some(ue=>this.syncResource.profile.id===ue.id)||oe.valueChanges.some(({profile:ue,changes:ae})=>this.syncResource.profile.id===ue.id&&ae.some($=>$.target===0)))))(()=>this.triggerLocalChange()))}async generateSyncPreview(U,F,M){const z=U.syncData?JSON.parse(U.syncData.content):null;F=F===null&&M?U:F;const V=F&&F.syncData?JSON.parse(F.syncData.content):null,J=await this.localGlobalStateProvider.getLocalGlobalState(this.syncResource.profile);z?this.logService.trace(`${this.syncResourceLogLabel}: Merging remote ui state with local ui state...`):this.logService.trace(`${this.syncResourceLogLabel}: Remote ui state does not exist. Synchronizing ui state for the first time.`);const H=await this.getStorageKeys(V),{local:Y,remote:B}=(0,m.merge)(J.storage,z?z.storage:null,V?V.storage:null,H,this.logService),K={content:null,local:Y,remote:B,localChange:Object.keys(Y.added).length>0||Object.keys(Y.updated).length>0||Y.removed.length>0?2:0,remoteChange:B.all!==null?2:0},x=i(J,!1);return[{baseResource:this.baseResource,baseContent:V?i(V,!1):x,localResource:this.localResource,localContent:x,localUserData:J,remoteResource:this.remoteResource,remoteContent:z?i(z,!1):null,previewResource:this.previewResource,previewResult:K,localChange:K.localChange,remoteChange:K.remoteChange,acceptedResource:this.acceptedResource,storageKeys:H}]}async hasRemoteChanged(U){const F=U.syncData?JSON.parse(U.syncData.content):null;if(F===null)return!0;const M=await this.localGlobalStateProvider.getLocalGlobalState(this.syncResource.profile),z=await this.getStorageKeys(F),{remote:V}=(0,m.merge)(M.storage,F.storage,F.storage,z,this.logService);return V.all!==null}async getMergeResult(U,F){return{...U.previewResult,hasConflicts:!1}}async getAcceptResult(U,F,M,z){if(this.extUri.isEqual(F,this.localResource))return this.acceptLocal(U);if(this.extUri.isEqual(F,this.remoteResource))return this.acceptRemote(U);if(this.extUri.isEqual(F,this.previewResource))return U.previewResult;throw new Error(`Invalid Resource: ${F.toString()}`)}async acceptLocal(U){return{content:U.localContent,local:{added:{},removed:[],updated:{}},remote:{added:Object.keys(U.localUserData.storage),removed:[],updated:[],all:U.localUserData.storage},localChange:0,remoteChange:2}}async acceptRemote(U){if(U.remoteContent!==null){const F=JSON.parse(U.remoteContent),{local:M,remote:z}=(0,m.merge)(U.localUserData.storage,F.storage,null,U.storageKeys,this.logService);return{content:U.remoteContent,local:M,remote:z,localChange:Object.keys(M.added).length>0||Object.keys(M.updated).length>0||M.removed.length>0?2:0,remoteChange:z!==null?2:0}}else return{content:U.remoteContent,local:{added:{},removed:[],updated:{}},remote:{added:[],removed:[],updated:[],all:null},localChange:0,remoteChange:0}}async applyResult(U,F,M,z){const{localUserData:V}=M[0][0],{local:J,remote:H,localChange:Y,remoteChange:B}=M[0][1];if(Y===0&&B===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing ui state.`),Y!==0&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating local ui state...`),await this.backupLocal(JSON.stringify(V)),await this.localGlobalStateProvider.writeLocalGlobalState(J,this.syncResource.profile),this.logService.info(`${this.syncResourceLogLabel}: Updated local ui state`)),B!==0){this.logService.trace(`${this.syncResourceLogLabel}: Updating remote ui state...`);const K=JSON.stringify({storage:H.all});U=await this.updateRemoteUserData(K,z?null:U.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote ui state.${H.added.length?` Added: ${H.added}.`:""}${H.updated.length?` Updated: ${H.updated}.`:""}${H.removed.length?` Removed: ${H.removed}.`:""}`)}F?.ref!==U.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized ui state...`),await this.updateLastSyncUserData(U),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized ui state`))}async resolveContent(U){if(this.extUri.isEqual(this.remoteResource,U)||this.extUri.isEqual(this.baseResource,U)||this.extUri.isEqual(this.localResource,U)||this.extUri.isEqual(this.acceptedResource,U)){const F=await this.resolvePreviewContent(U);return F&&i(JSON.parse(F),!0)}return null}async hasLocalData(){try{const{storage:U}=await this.localGlobalStateProvider.getLocalGlobalState(this.syncResource.profile);if(Object.keys(U).length>1||U[`${n}.locale`]?.value!=="en")return!0}catch{}return!1}async getStorageKeys(U){const F=await this.userDataProfileStorageService.readStorageData(this.syncResource.profile),M=[],z=[];for(const[H,Y]of F)Y.target===0?M.push(H):Y.target===1&&z.push(H);const V=[...M,...z],J=U?.storage?Object.keys(U.storage).filter(H=>!H.startsWith(n)&&!V.includes(H)&&F.get(H)!==void 0):[];if(!D.isWeb){const H=[...y.ALL_SYNC_RESOURCES.map(Y=>(0,y.getEnablementKey)(Y)),y.SYNC_SERVICE_URL_TYPE];J.push(...H),z.push(...H)}return{user:M,machine:z,unregistered:J}}};e.GlobalStateSynchroniser=a,e.GlobalStateSynchroniser=a=Ee([G(2,t.IUserDataProfileStorageService),G(3,p.IFileService),G(4,y.IUserDataSyncStoreService),G(5,y.IUserDataSyncBackupStoreService),G(6,y.IUserDataSyncLogService),G(7,P.IEnvironmentService),G(8,y.IUserDataSyncEnablementService),G(9,w.ITelemetryService),G(10,S.IConfigurationService),G(11,f.IStorageService),G(12,l.IUriIdentityService),G(13,o.IInstantiationService)],a);let E=class{constructor(U,F,M,z){this.fileService=U,this.environmentService=F,this.userDataProfileStorageService=M,this.logService=z}async getLocalGlobalState(U){const F={};if(U.isDefault){const z=await this.getLocalArgvContent(),V=(0,_.parse)(z);for(const J of s)V[J]!==void 0&&(F[`${n}${J}`]={version:1,value:V[J]})}const M=await this.userDataProfileStorageService.readStorageData(U);for(const[z,V]of M)V.value&&V.target===0&&(F[z]={version:1,value:V.value});return{storage:F}}async getLocalArgvContent(){try{this.logService.debug("GlobalStateSync#getLocalArgvContent",this.environmentService.argvResource);const U=await this.fileService.readFile(this.environmentService.argvResource);return this.logService.debug("GlobalStateSync#getLocalArgvContent - Resolved",this.environmentService.argvResource),U.value.toString()}catch(U){this.logService.debug((0,O.getErrorMessage)(U))}return"{}"}async writeLocalGlobalState({added:U,removed:F,updated:M},z){const V=(0,d.getSyncResourceLogLabel)("globalState",z),J={},H=new Map,Y=await this.userDataProfileStorageService.readStorageData(z),B=(K,x)=>{for(const q of K){if(q.startsWith(n)){J[q.substring(n.length)]=x?x[q].value:void 0;continue}if(x){const j=x[q];j.value!==Y.get(q)?.value&&H.set(q,j.value)}else Y.get(q)!==void 0&&H.set(q,void 0)}};if(B(Object.keys(U),U),B(Object.keys(M),M),B(F),Object.keys(J).length){this.logService.trace(`${V}: Updating locale...`);const K=await this.getLocalArgvContent();let x=K;for(const q of Object.keys(J))x=(0,c.edit)(x,[q],J[q],{});K!==x&&(this.logService.trace(`${V}: Updating locale...`),await this.fileService.writeFile(this.environmentService.argvResource,I.VSBuffer.fromString(x)),this.logService.info(`${V}: Updated locale.`)),this.logService.info(`${V}: Updated locale`)}H.size&&(this.logService.trace(`${V}: Updating global state...`),await this.userDataProfileStorageService.updateStorageData(z,H,0),this.logService.info(`${V}: Updated global state`,[...H.keys()]))}};e.LocalGlobalStateProvider=E,e.LocalGlobalStateProvider=E=Ee([G(0,p.IFileService),G(1,P.IEnvironmentService),G(2,t.IUserDataProfileStorageService),G(3,y.IUserDataSyncLogService)],E);let v=class extends d.AbstractInitializer{constructor(U,F,M,z,V,J){super("globalState",M,z,V,F,U,J)}async doInitialize(U){const F=U.syncData?JSON.parse(U.syncData.content):null;if(!F){this.logService.info("Skipping initializing global state because remote global state does not exist.");return}const M={},z={};for(const V of Object.keys(F.storage))V.startsWith(n)?M[V.substring(n.length)]=F.storage[V].value:this.storageService.get(V,0)===void 0&&(z[V]=F.storage[V].value);if(Object.keys(M).length){let V="{}";try{V=(await this.fileService.readFile(this.environmentService.argvResource)).value.toString()}catch{}for(const J of Object.keys(M))V=(0,c.edit)(V,[J],M[J],{});await this.fileService.writeFile(this.environmentService.argvResource,I.VSBuffer.fromString(V))}if(Object.keys(z).length){const V=[];for(const J of Object.keys(z))V.push({key:J,value:z[J],scope:0,target:0});this.storageService.storeAll(V,!0)}}};e.GlobalStateInitializer=v,e.GlobalStateInitializer=v=Ee([G(0,f.IStorageService),G(1,p.IFileService),G(2,T.IUserDataProfilesService),G(3,P.IEnvironmentService),G(4,y.IUserDataSyncLogService),G(5,l.IUriIdentityService)],v);let u=class{constructor(U,F,M,z,V){this.userDataSyncStoreClient=U,this.storageService=F,this.environmentService=M,this.fileService=z,this.logService=V}getSyncStoreType(U){return this.parseGlobalState(U)?.storage[y.SYNC_SERVICE_URL_TYPE]?.value}async sync(U){const F=(0,y.createSyncHeaders)((0,b.generateUuid)());try{return await this.doSync(U,F)}catch(M){if(M instanceof y.UserDataSyncError)switch(M.code){case"PreconditionFailed":return this.logService.info("Failed to synchronize UserDataSyncStoreType as there is a new remote version available. Synchronizing again..."),this.doSync(U,F)}throw M}}async doSync(U,F){const M=await this.userDataSyncStoreClient.readResource("globalState",null,void 0,F),z=this.parseGlobalState(M)||{storage:{}};z.storage[y.SYNC_SERVICE_URL_TYPE]={value:U,version:r};const V=await(0,h.getServiceMachineId)(this.environmentService,this.fileService,this.storageService),J={version:r,machineId:V,content:i(z,!1)};await this.userDataSyncStoreClient.writeResource("globalState",JSON.stringify(J),M.ref,void 0,F)}parseGlobalState({content:U}){if(!U)return null;const F=JSON.parse(U);if((0,d.isSyncData)(F))return F?JSON.parse(F.content):null;throw new Error("Invalid remote data")}};e.UserDataSyncStoreTypeSynchronizer=u,e.UserDataSyncStoreTypeSynchronizer=u=Ee([G(1,f.IStorageService),G(2,P.IEnvironmentService),G(3,p.IFileService),G(4,g.ILogService)],u)}),define(ce[118],le([0,1,20,14,3,34,6,12,171,18,15,13,19,21,27,17,39,233,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeybindingsInitializer=e.KeybindingsSynchroniser=e.getKeybindingsContentFromSyncContent=void 0;function m(t,o,n){try{const s=JSON.parse(t);if(!o)return(0,D.isUndefined)(s.all)?null:s.all;switch(k.OS){case 2:return(0,D.isUndefined)(s.mac)?null:s.mac;case 3:return(0,D.isUndefined)(s.linux)?null:s.linux;case 1:return(0,D.isUndefined)(s.windows)?null:s.windows}}catch(s){return n.error(s),null}}e.getKeybindingsContentFromSyncContent=m;let y=class extends l.AbstractJsonFileSynchroniser{constructor(o,n,s,i,r,a,E,v,u,C,U,F,M){super(o.keybindingsResource,{syncResource:"keybindings",profile:o},n,v,u,C,s,i,E,F,r,U,a,M),this.version=2,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"keybindings.json"),this.baseResource=this.previewResource.with({scheme:c.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:c.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:c.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:c.USER_DATA_SYNC_SCHEME,authority:"accepted"}),this._register(A.Event.filter(a.onDidChangeConfiguration,z=>z.affectsConfiguration("settingsSync.keybindingsPerPlatform"))(()=>this.triggerLocalChange()))}async generateSyncPreview(o,n,s,i){const r=o.syncData?m(o.syncData.content,i.keybindingsPerPlatform??this.syncKeybindingsPerPlatform(),this.logService):null;n=n===null&&s?o:n;const a=n?this.getKeybindingsContentFromLastSyncUserData(n):null,E=await this.getLocalFileContent(),v=await this.getFormattingOptions();let u=null,C=!1,U=!1,F=!1;if(r){let V=E?E.value.toString():"[]";if(V=V||"[]",this.hasErrors(V,!0))throw new c.UserDataSyncError((0,b.localize)(0,null),"LocalInvalidContent",this.resource);if(!a||a!==V||a!==r){this.logService.trace(`${this.syncResourceLogLabel}: Merging remote keybindings with local keybindings...`);const J=await(0,d.merge)(V,r,a,v,this.userDataSyncUtilService);J.hasChanges&&(u=J.mergeContent,F=J.hasConflicts,C=F||J.mergeContent!==V,U=F||J.mergeContent!==r)}}else E&&(this.logService.trace(`${this.syncResourceLogLabel}: Remote keybindings does not exist. Synchronizing keybindings for the first time.`),u=E.value.toString(),U=!0);const M={content:F?a:u,localChange:C?E?2:1:0,remoteChange:U?2:0,hasConflicts:F},z=E?E.value.toString():null;return[{fileContent:E,baseResource:this.baseResource,baseContent:a,localResource:this.localResource,localContent:z,localChange:M.localChange,remoteResource:this.remoteResource,remoteContent:r,remoteChange:M.remoteChange,previewResource:this.previewResource,previewResult:M,acceptedResource:this.acceptedResource}]}async hasRemoteChanged(o){const n=this.getKeybindingsContentFromLastSyncUserData(o);if(n===null)return!0;const s=await this.getLocalFileContent(),i=s?s.value.toString():"",r=await this.getFormattingOptions(),a=await(0,d.merge)(i||"[]",n,n,r,this.userDataSyncUtilService);return a.hasConflicts||a.mergeContent!==n}async getMergeResult(o,n){return o.previewResult}async getAcceptResult(o,n,s,i){if(this.extUri.isEqual(n,this.localResource))return{content:o.fileContent?o.fileContent.value.toString():null,localChange:0,remoteChange:2};if(this.extUri.isEqual(n,this.remoteResource))return{content:o.remoteContent,localChange:2,remoteChange:0};if(this.extUri.isEqual(n,this.previewResource))return s===void 0?{content:o.previewResult.content,localChange:o.previewResult.localChange,remoteChange:o.previewResult.remoteChange}:{content:s,localChange:2,remoteChange:2};throw new Error(`Invalid Resource: ${n.toString()}`)}async applyResult(o,n,s,i){const{fileContent:r}=s[0][0];let{content:a,localChange:E,remoteChange:v}=s[0][1];if(E===0&&v===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing keybindings.`),a!==null&&(a=a.trim(),a=a||"[]",this.hasErrors(a,!0)))throw new c.UserDataSyncError((0,b.localize)(1,null),"LocalInvalidContent",this.resource);if(E!==0&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating local keybindings...`),r&&await this.backupLocal(this.toSyncContent(r.value.toString())),await this.updateLocalFileContent(a||"[]",r,i),this.logService.info(`${this.syncResourceLogLabel}: Updated local keybindings`)),v!==0){this.logService.trace(`${this.syncResourceLogLabel}: Updating remote keybindings...`);const u=this.toSyncContent(a||"[]",o.syncData?.content);o=await this.updateRemoteUserData(u,i?null:o.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote keybindings`)}try{await this.fileService.del(this.previewResource)}catch{}n?.ref!==o.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized keybindings...`),await this.updateLastSyncUserData(o,{platformSpecific:this.syncKeybindingsPerPlatform()}),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized keybindings`))}async hasLocalData(){try{const o=await this.getLocalFileContent();if(o){const n=(0,_.parse)(o.value.toString());if((0,I.isNonEmptyArray)(n))return!0}}catch(o){if(o.fileOperationResult!==1)return!0}return!1}async resolveContent(o){return this.extUri.isEqual(this.remoteResource,o)||this.extUri.isEqual(this.baseResource,o)||this.extUri.isEqual(this.localResource,o)||this.extUri.isEqual(this.acceptedResource,o)?this.resolvePreviewContent(o):null}getKeybindingsContentFromLastSyncUserData(o){return!o.syncData||o.platformSpecific!==void 0&&o.platformSpecific!==this.syncKeybindingsPerPlatform()?null:m(o.syncData.content,this.syncKeybindingsPerPlatform(),this.logService)}toSyncContent(o,n){let s={};try{s=JSON.parse(n||"{}")}catch(i){this.logService.error(i)}switch(this.syncKeybindingsPerPlatform()?delete s.all:s.all=o,k.OS){case 2:s.mac=o;break;case 3:s.linux=o;break;case 1:s.windows=o;break}return JSON.stringify(s)}syncKeybindingsPerPlatform(){return!!this.configurationService.getValue(c.CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM)}};e.KeybindingsSynchroniser=y,e.KeybindingsSynchroniser=y=Ee([G(2,c.IUserDataSyncStoreService),G(3,c.IUserDataSyncBackupStoreService),G(4,c.IUserDataSyncLogService),G(5,S.IConfigurationService),G(6,c.IUserDataSyncEnablementService),G(7,p.IFileService),G(8,P.IEnvironmentService),G(9,g.IStorageService),G(10,c.IUserDataSyncUtilService),G(11,h.ITelemetryService),G(12,f.IUriIdentityService)],y);let T=class extends l.AbstractInitializer{constructor(o,n,s,i,r,a){super("keybindings",n,s,i,o,r,a)}async doInitialize(o){const n=o.syncData?this.getKeybindingsContentFromSyncContent(o.syncData.content):null;if(!n){this.logService.info("Skipping initializing keybindings because remote keybindings does not exist.");return}if(!await this.isEmpty()){this.logService.info("Skipping initializing keybindings because local keybindings exist.");return}await this.fileService.writeFile(this.userDataProfilesService.defaultProfile.keybindingsResource,O.VSBuffer.fromString(n)),await this.updateLastSyncUserData(o)}async isEmpty(){try{const o=await this.fileService.readFile(this.userDataProfilesService.defaultProfile.settingsResource),n=(0,_.parse)(o.value.toString());return!(0,I.isNonEmptyArray)(n)}catch(o){return o.fileOperationResult===1}}getKeybindingsContentFromSyncContent(o){try{return m(o,!0,this.logService)}catch(n){return this.logService.error(n),null}}};e.KeybindingsInitializer=T,e.KeybindingsInitializer=T=Ee([G(0,p.IFileService),G(1,w.IUserDataProfilesService),G(2,P.IEnvironmentService),G(3,c.IUserDataSyncLogService),G(4,g.IStorageService),G(5,f.IUriIdentityService)],T)}),define(ce[119],le([0,1,14,3,172,18,73,15,29,13,19,21,27,17,39,237,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SettingsInitializer=e.SettingsSynchroniser=e.parseSettingsSyncContent=void 0;function d(T){return T&&T.settings&&typeof T.settings=="string"&&Object.keys(T).length===1}function c(T){const t=JSON.parse(T);return d(t)?t:{settings:T}}e.parseSettingsSyncContent=c;let m=class extends f.AbstractJsonFileSynchroniser{constructor(t,o,n,s,i,r,a,E,v,u,C,U,F,M){super(t.settingsResource,{syncResource:"settings",profile:t},o,n,s,i,r,a,C,U,E,v,u,M),this.extensionManagementService=F,this.version=2,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"settings.json"),this.baseResource=this.previewResource.with({scheme:l.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:l.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:l.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:l.USER_DATA_SYNC_SCHEME,authority:"accepted"}),this._defaultIgnoredSettings=void 0}async getRemoteUserDataSyncConfiguration(t){const o=await this.getLastSyncUserData(),n=await this.getLatestRemoteUserData(t,o),s=this.getSettingsSyncContent(n),i=new k.ConfigurationModelParser(l.USER_DATA_SYNC_CONFIGURATION_SCOPE);return s?.settings&&i.parse(s.settings),i.configurationModel.getValue(l.USER_DATA_SYNC_CONFIGURATION_SCOPE)||{}}async generateSyncPreview(t,o,n){const s=await this.getLocalFileContent(),i=await this.getFormattingOptions(),r=this.getSettingsSyncContent(t);o=o===null&&n?t:o;const a=o?this.getSettingsSyncContent(o):null,E=await this.getIgnoredSettings();let v=null,u=!1,C=!1,U=!1;if(r){let V=s?s.value.toString().trim():"{}";V=V||"{}",this.validateContent(V),this.logService.trace(`${this.syncResourceLogLabel}: Merging remote settings with local settings...`);const J=(0,w.merge)(V,r.settings,a?a.settings:null,E,[],i);v=J.localContent||J.remoteContent,u=J.localContent!==null,C=J.remoteContent!==null,U=J.hasConflicts}else s&&(this.logService.trace(`${this.syncResourceLogLabel}: Remote settings does not exist. Synchronizing settings for the first time.`),v=s.value.toString().trim()||"{}",this.validateContent(v),C=!0);const F=s?s.value.toString():null,M=a?.settings??null,z={content:U?M:v,localChange:u?2:0,remoteChange:C?2:0,hasConflicts:U};return[{fileContent:s,baseResource:this.baseResource,baseContent:M,localResource:this.localResource,localContent:F,localChange:z.localChange,remoteResource:this.remoteResource,remoteContent:r?r.settings:null,remoteChange:z.remoteChange,previewResource:this.previewResource,previewResult:z,acceptedResource:this.acceptedResource}]}async hasRemoteChanged(t){const o=this.getSettingsSyncContent(t);if(o===null)return!0;const n=await this.getLocalFileContent(),s=n?n.value.toString().trim():"",i=await this.getIgnoredSettings(),r=await this.getFormattingOptions();return(0,w.merge)(s||"{}",o.settings,o.settings,i,[],r).remoteContent!==null}async getMergeResult(t,o){const n=await this.getFormattingOptions(),s=await this.getIgnoredSettings();return{...t.previewResult,content:t.previewResult.content?(0,w.updateIgnoredSettings)(t.previewResult.content,"{}",s,n):null}}async getAcceptResult(t,o,n,s){const i=await this.getFormattingOptions(),r=await this.getIgnoredSettings();if(this.extUri.isEqual(o,this.localResource))return{content:t.fileContent?(0,w.updateIgnoredSettings)(t.fileContent.value.toString(),"{}",r,i):null,localChange:0,remoteChange:2};if(this.extUri.isEqual(o,this.remoteResource))return{content:t.remoteContent!==null?(0,w.updateIgnoredSettings)(t.remoteContent,t.fileContent?t.fileContent.value.toString():"{}",r,i):null,localChange:2,remoteChange:0};if(this.extUri.isEqual(o,this.previewResource))return n===void 0?{content:t.previewResult.content,localChange:t.previewResult.localChange,remoteChange:t.previewResult.remoteChange}:{content:n!==null?(0,w.updateIgnoredSettings)(n,t.fileContent?t.fileContent.value.toString():"{}",r,i):null,localChange:2,remoteChange:2};throw new Error(`Invalid Resource: ${o.toString()}`)}async applyResult(t,o,n,s){const{fileContent:i}=n[0][0];let{content:r,localChange:a,remoteChange:E}=n[0][1];if(a===0&&E===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing settings.`),r=r?r.trim():"{}",r=r||"{}",this.validateContent(r),a!==0&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating local settings...`),i&&await this.backupLocal(JSON.stringify(this.toSettingsSyncContent(i.value.toString()))),await this.updateLocalFileContent(r,i,s),await this.configurationService.reloadConfiguration(3),this.logService.info(`${this.syncResourceLogLabel}: Updated local settings`)),E!==0){const v=await this.getFormattingOptions(),u=this.getSettingsSyncContent(t),C=await this.getIgnoredSettings(r);r=(0,w.updateIgnoredSettings)(r,u?u.settings:"{}",C,v),this.logService.trace(`${this.syncResourceLogLabel}: Updating remote settings...`),t=await this.updateRemoteUserData(JSON.stringify(this.toSettingsSyncContent(r)),s?null:t.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote settings`)}try{await this.fileService.del(this.previewResource)}catch{}o?.ref!==t.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized settings...`),await this.updateLastSyncUserData(t),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized settings`))}async hasLocalData(){try{const t=await this.getLocalFileContent();if(t)return!(0,w.isEmpty)(t.value.toString())}catch(t){if(t.fileOperationResult!==1)return!0}return!1}async resolveContent(t){return this.extUri.isEqual(this.remoteResource,t)||this.extUri.isEqual(this.localResource,t)||this.extUri.isEqual(this.acceptedResource,t)||this.extUri.isEqual(this.baseResource,t)?this.resolvePreviewContent(t):null}async resolvePreviewContent(t){let o=await super.resolvePreviewContent(t);if(o){const n=await this.getFormattingOptions(),s=await this.getIgnoredSettings();o=(0,w.updateIgnoredSettings)(o,"{}",s,n)}return o}getSettingsSyncContent(t){return t.syncData?this.parseSettingsSyncContent(t.syncData.content):null}parseSettingsSyncContent(t){try{return c(t)}catch(o){this.logService.error(o)}return null}toSettingsSyncContent(t){return{settings:t}}async getIgnoredSettings(t){if(!this._defaultIgnoredSettings){this._defaultIgnoredSettings=this.userDataSyncUtilService.resolveDefaultIgnoredSettings();const n=O.Event.any(O.Event.filter(this.extensionManagementService.onDidInstallExtensions,s=>s.some(({local:i})=>!!i)),O.Event.filter(this.extensionManagementService.onDidUninstallExtension,s=>!s.error))(()=>{n.dispose(),this._defaultIgnoredSettings=void 0})}const o=await this._defaultIgnoredSettings;return(0,w.getIgnoredSettings)(o,this.configurationService,t)}validateContent(t){if(this.hasErrors(t,!1))throw new l.UserDataSyncError((0,A.localize)(0,null),"LocalInvalidContent",this.resource)}};e.SettingsSynchroniser=m,e.SettingsSynchroniser=m=Ee([G(2,S.IFileService),G(3,D.IEnvironmentService),G(4,P.IStorageService),G(5,l.IUserDataSyncStoreService),G(6,l.IUserDataSyncBackupStoreService),G(7,l.IUserDataSyncLogService),G(8,l.IUserDataSyncUtilService),G(9,_.IConfigurationService),G(10,l.IUserDataSyncEnablementService),G(11,p.ITelemetryService),G(12,b.IExtensionManagementService),G(13,g.IUriIdentityService)],m);let y=class extends f.AbstractInitializer{constructor(t,o,n,s,i,r){super("settings",o,n,s,t,i,r)}async doInitialize(t){const o=t.syncData?this.parseSettingsSyncContent(t.syncData.content):null;if(!o){this.logService.info("Skipping initializing settings because remote settings does not exist.");return}if(!await this.isEmpty()){this.logService.info("Skipping initializing settings because local settings exist.");return}await this.fileService.writeFile(this.userDataProfilesService.defaultProfile.settingsResource,I.VSBuffer.fromString(o.settings)),await this.updateLastSyncUserData(t)}async isEmpty(){try{const t=await this.fileService.readFile(this.userDataProfilesService.defaultProfile.settingsResource);return(0,w.isEmpty)(t.value.toString().trim())}catch(t){return t.fileOperationResult===1}}parseSettingsSyncContent(t){try{return c(t)}catch(o){this.logService.error(o)}return null}};e.SettingsInitializer=y,e.SettingsInitializer=y=Ee([G(0,S.IFileService),G(1,h.IUserDataProfilesService),G(2,D.IEnvironmentService),G(3,l.IUserDataSyncLogService),G(4,P.IStorageService),G(5,g.IUriIdentityService)],y)}),define(ce[120],le([0,1,14,3,30,18,15,13,19,21,27,17,39,234,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SnippetsInitializer=e.SnippetsSynchroniser=e.parseSnippets=void 0;function w(c){return JSON.parse(c.content)}e.parseSnippets=w;let l=class extends g.AbstractSynchroniser{constructor(m,y,T,t,o,n,s,i,r,a,E,v){super({syncResource:"snippets",profile:m},y,t,T,o,n,s,a,E,i,r,v),this.version=1,this.snippetsFolder=m.snippetsHome,this._register(this.fileService.watch(T.userRoamingDataHome)),this._register(this.fileService.watch(this.snippetsFolder)),this._register(O.Event.filter(this.fileService.onDidFilesChange,u=>u.affects(this.snippetsFolder))(()=>this.triggerLocalChange()))}async generateSyncPreview(m,y,T){const t=await this.getSnippetsFileContents(),o=this.toSnippetsContents(t),n=m.syncData?this.parseSnippets(m.syncData):null;y=y===null&&T?m:y;const s=y&&y.syncData?this.parseSnippets(y.syncData):null;n?this.logService.trace(`${this.syncResourceLogLabel}: Merging remote snippets with local snippets...`):this.logService.trace(`${this.syncResourceLogLabel}: Remote snippets does not exist. Synchronizing snippets for the first time.`);const i=(0,h.merge)(o,n,s);return this.getResourcePreviews(i,t,n||{},s||{})}async hasRemoteChanged(m){const y=m.syncData?this.parseSnippets(m.syncData):null;if(y===null)return!0;const T=await this.getSnippetsFileContents(),t=this.toSnippetsContents(T),o=(0,h.merge)(t,y,y);return Object.keys(o.remote.added).length>0||Object.keys(o.remote.updated).length>0||o.remote.removed.length>0||o.conflicts.length>0}async getMergeResult(m,y){return m.previewResult}async getAcceptResult(m,y,T,t){if(this.extUri.isEqualOrParent(y,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"})))return{content:m.fileContent?m.fileContent.value.toString():null,localChange:0,remoteChange:m.fileContent?m.remoteContent!==null?2:1:3};if(this.extUri.isEqualOrParent(y,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"})))return{content:m.remoteContent,localChange:m.remoteContent!==null?m.fileContent?2:1:3,remoteChange:0};if(this.extUri.isEqualOrParent(y,this.syncPreviewFolder))return T===void 0?{content:m.previewResult.content,localChange:m.previewResult.localChange,remoteChange:m.previewResult.remoteChange}:{content:T,localChange:T===null?m.fileContent!==null?3:0:2,remoteChange:T===null?m.remoteContent!==null?3:0:2};throw new Error(`Invalid Resource: ${y.toString()}`)}async applyResult(m,y,T,t){const o=T.map(([n,s])=>({...n,acceptResult:s}));o.every(({localChange:n,remoteChange:s})=>n===0&&s===0)&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing snippets.`),o.some(({localChange:n})=>n!==0)&&(await this.updateLocalBackup(o),await this.updateLocalSnippets(o,t)),o.some(({remoteChange:n})=>n!==0)&&(m=await this.updateRemoteSnippets(o,m,t)),y?.ref!==m.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized snippets...`),await this.updateLastSyncUserData(m),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized snippets`));for(const{previewResource:n}of o)try{await this.fileService.del(n)}catch{}}getResourcePreviews(m,y,T,t){const o=new Map;for(const n of Object.keys(m.local.added)){const s={content:m.local.added[n],hasConflicts:!1,localChange:1,remoteChange:0};o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:null,fileContent:null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),localContent:null,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n],previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of Object.keys(m.local.updated)){const s={content:m.local.updated[n],hasConflicts:!1,localChange:2,remoteChange:0},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n],localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n],previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of m.local.removed){const s={content:null,hasConflicts:!1,localChange:3,remoteChange:0},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n],localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:null,previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of Object.keys(m.remote.added)){const s={content:m.remote.added[n],hasConflicts:!1,localChange:0,remoteChange:1},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n],localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:null,previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of Object.keys(m.remote.updated)){const s={content:m.remote.updated[n],hasConflicts:!1,localChange:0,remoteChange:2},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n],localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n],previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of m.remote.removed){const s={content:null,hasConflicts:!1,localChange:0,remoteChange:3};o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:null,localContent:null,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n],previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of m.conflicts){const s={content:t[n]??null,hasConflicts:!0,localChange:y[n]?2:1,remoteChange:T[n]?2:1},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n]||null,localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n]||null,previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}for(const n of Object.keys(y))if(!o.has(n)){const s={content:y[n]?y[n].value.toString():null,hasConflicts:!1,localChange:0,remoteChange:0},i=y[n]?y[n].value.toString():null;o.set(n,{baseResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}),baseContent:t[n]??null,localResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}),fileContent:y[n]||null,localContent:i,remoteResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}),remoteContent:T[n]||null,previewResource:this.extUri.joinPath(this.syncPreviewFolder,n),previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.extUri.joinPath(this.syncPreviewFolder,n).with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"})})}return[...o.values()]}async resolveContent(m){return this.extUri.isEqualOrParent(m,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"remote"}))||this.extUri.isEqualOrParent(m,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"local"}))||this.extUri.isEqualOrParent(m,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"base"}))||this.extUri.isEqualOrParent(m,this.syncPreviewFolder.with({scheme:f.USER_DATA_SYNC_SCHEME,authority:"accepted"}))?this.resolvePreviewContent(m):null}async hasLocalData(){try{const m=await this.getSnippetsFileContents();if(Object.keys(m).length)return!0}catch{}return!1}async updateLocalBackup(m){const y={};for(const T of m)T.fileContent&&(y[this.extUri.basename(T.localResource)]=T.fileContent);await this.backupLocal(JSON.stringify(this.toSnippetsContents(y)))}async updateLocalSnippets(m,y){for(const{fileContent:T,acceptResult:t,localResource:o,remoteResource:n,localChange:s}of m)if(s!==0){const i=n?this.extUri.basename(n):this.extUri.basename(o),r=this.extUri.joinPath(this.snippetsFolder,i);s===3?(this.logService.trace(`${this.syncResourceLogLabel}: Deleting snippet...`,this.extUri.basename(r)),await this.fileService.del(r),this.logService.info(`${this.syncResourceLogLabel}: Deleted snippet`,this.extUri.basename(r))):s===1?(this.logService.trace(`${this.syncResourceLogLabel}: Creating snippet...`,this.extUri.basename(r)),await this.fileService.createFile(r,I.VSBuffer.fromString(t.content),{overwrite:y}),this.logService.info(`${this.syncResourceLogLabel}: Created snippet`,this.extUri.basename(r))):(this.logService.trace(`${this.syncResourceLogLabel}: Updating snippet...`,this.extUri.basename(r)),await this.fileService.writeFile(r,I.VSBuffer.fromString(t.content),y?void 0:T),this.logService.info(`${this.syncResourceLogLabel}: Updated snippet`,this.extUri.basename(r)))}}async updateRemoteSnippets(m,y,T){const t=y.syncData?this.parseSnippets(y.syncData):{},o=(0,A.deepClone)(t);for(const{acceptResult:n,localResource:s,remoteResource:i,remoteChange:r}of m)if(r!==0){const a=s?this.extUri.basename(s):this.extUri.basename(i);r===3?delete o[a]:o[a]=n.content}return(0,h.areSame)(t,o)||(this.logService.trace(`${this.syncResourceLogLabel}: Updating remote snippets...`),y=await this.updateRemoteUserData(JSON.stringify(o),T?null:y.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote snippets`)),y}parseSnippets(m){return w(m)}toSnippetsContents(m){const y={};for(const T of Object.keys(m))y[T]=m[T].value.toString();return y}async getSnippetsFileContents(){const m={};let y;try{y=await this.fileService.resolve(this.snippetsFolder)}catch(T){if(T instanceof D.FileOperationError&&T.fileOperationResult===1)return m;throw T}for(const T of y.children||[]){const t=T.resource,o=this.extUri.extname(t);if(o===".json"||o===".code-snippets"){const n=this.extUri.relativePath(this.snippetsFolder,t),s=await this.fileService.readFile(t);m[n]=s}}return m}};e.SnippetsSynchroniser=l,e.SnippetsSynchroniser=l=Ee([G(2,k.IEnvironmentService),G(3,D.IFileService),G(4,b.IStorageService),G(5,f.IUserDataSyncStoreService),G(6,f.IUserDataSyncBackupStoreService),G(7,f.IUserDataSyncLogService),G(8,_.IConfigurationService),G(9,f.IUserDataSyncEnablementService),G(10,S.ITelemetryService),G(11,P.IUriIdentityService)],l);let d=class extends g.AbstractInitializer{constructor(m,y,T,t,o,n){super("snippets",y,T,t,m,o,n)}async doInitialize(m){const y=m.syncData?JSON.parse(m.syncData.content):null;if(!y){this.logService.info("Skipping initializing snippets because remote snippets does not exist.");return}if(!await this.isEmpty()){this.logService.info("Skipping initializing snippets because local snippets exist.");return}for(const t of Object.keys(y)){const o=y[t];if(o){const n=this.extUri.joinPath(this.userDataProfilesService.defaultProfile.snippetsHome,t);await this.fileService.createFile(n,I.VSBuffer.fromString(o)),this.logService.info("Created snippet",this.extUri.basename(n))}}await this.updateLastSyncUserData(m)}async isEmpty(){try{return!(await this.fileService.resolve(this.userDataProfilesService.defaultProfile.snippetsHome)).children?.length}catch(m){return m.fileOperationResult===1}}};e.SnippetsInitializer=d,e.SnippetsInitializer=d=Ee([G(0,D.IFileService),G(1,p.IUserDataProfilesService),G(2,k.IEnvironmentService),G(3,f.IUserDataSyncLogService),G(4,b.IStorageService),G(5,P.IUriIdentityService)],d)}),define(ce[121],le([0,1,14,18,15,13,19,21,27,17,39,24]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TasksInitializer=e.TasksSynchroniser=e.getTasksContentFromSyncContent=void 0;function g(l,d){try{return JSON.parse(l).tasks??null}catch(c){return d.error(c),null}}e.getTasksContentFromSyncContent=g;let h=class extends P.AbstractFileSynchroniser{constructor(d,c,m,y,T,t,o,n,s,i,r,a){super(d.tasksResource,{syncResource:"tasks",profile:d},c,n,s,i,m,y,o,r,T,t,a),this.version=1,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"tasks.json"),this.baseResource=this.previewResource.with({scheme:p.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:p.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:p.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:p.USER_DATA_SYNC_SCHEME,authority:"accepted"})}async generateSyncPreview(d,c,m,y){const T=d.syncData?g(d.syncData.content,this.logService):null;c=c===null&&m?d:c;const t=c?.syncData?g(c.syncData.content,this.logService):null,o=await this.getLocalFileContent();let n=null,s=!1,i=!1,r=!1;if(d.syncData){const v=o?o.value.toString():null;if(!t||t!==v||t!==T){this.logService.trace(`${this.syncResourceLogLabel}: Merging remote tasks with local tasks...`);const u=w(v,T,t);n=u.content,r=u.hasConflicts,s=u.hasLocalChanged,i=u.hasRemoteChanged}}else o&&(this.logService.trace(`${this.syncResourceLogLabel}: Remote tasks does not exist. Synchronizing tasks for the first time.`),n=o.value.toString(),i=!0);const a={content:r?t:n,localChange:s?o?2:1:0,remoteChange:i?2:0,hasConflicts:r},E=o?o.value.toString():null;return[{fileContent:o,baseResource:this.baseResource,baseContent:t,localResource:this.localResource,localContent:E,localChange:a.localChange,remoteResource:this.remoteResource,remoteContent:T,remoteChange:a.remoteChange,previewResource:this.previewResource,previewResult:a,acceptedResource:this.acceptedResource}]}async hasRemoteChanged(d){const c=d?.syncData?g(d.syncData.content,this.logService):null;if(c===null)return!0;const m=await this.getLocalFileContent(),y=m?m.value.toString():null,T=w(y,c,c);return T.hasLocalChanged||T.hasRemoteChanged}async getMergeResult(d,c){return d.previewResult}async getAcceptResult(d,c,m,y){if(this.extUri.isEqual(c,this.localResource))return{content:d.fileContent?d.fileContent.value.toString():null,localChange:0,remoteChange:2};if(this.extUri.isEqual(c,this.remoteResource))return{content:d.remoteContent,localChange:2,remoteChange:0};if(this.extUri.isEqual(c,this.previewResource))return m===void 0?{content:d.previewResult.content,localChange:d.previewResult.localChange,remoteChange:d.previewResult.remoteChange}:{content:m,localChange:2,remoteChange:2};throw new Error(`Invalid Resource: ${c.toString()}`)}async applyResult(d,c,m,y){const{fileContent:T}=m[0][0],{content:t,localChange:o,remoteChange:n}=m[0][1];if(o===0&&n===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing tasks.`),o!==0&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating local tasks...`),T&&await this.backupLocal(JSON.stringify(this.toTasksSyncContent(T.value.toString()))),t?await this.updateLocalFileContent(t,T,y):await this.deleteLocalFile(),this.logService.info(`${this.syncResourceLogLabel}: Updated local tasks`)),n!==0){this.logService.trace(`${this.syncResourceLogLabel}: Updating remote tasks...`);const s=JSON.stringify(this.toTasksSyncContent(t));d=await this.updateRemoteUserData(s,y?null:d.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote tasks`)}try{await this.fileService.del(this.previewResource)}catch{}c?.ref!==d.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized tasks...`),await this.updateLastSyncUserData(d),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized tasks`))}async hasLocalData(){return this.fileService.exists(this.file)}async resolveContent(d){return this.extUri.isEqual(this.remoteResource,d)||this.extUri.isEqual(this.baseResource,d)||this.extUri.isEqual(this.localResource,d)||this.extUri.isEqual(this.acceptedResource,d)?this.resolvePreviewContent(d):null}toTasksSyncContent(d){return d?{tasks:d}:{}}};e.TasksSynchroniser=h,e.TasksSynchroniser=h=Ee([G(2,p.IUserDataSyncStoreService),G(3,p.IUserDataSyncBackupStoreService),G(4,p.IUserDataSyncLogService),G(5,O.IConfigurationService),G(6,p.IUserDataSyncEnablementService),G(7,_.IFileService),G(8,A.IEnvironmentService),G(9,k.IStorageService),G(10,D.ITelemetryService),G(11,b.IUriIdentityService)],h);let f=class extends P.AbstractInitializer{constructor(d,c,m,y,T,t){super("tasks",c,m,y,d,T,t),this.tasksResource=this.userDataProfilesService.defaultProfile.tasksResource}async doInitialize(d){const c=d.syncData?g(d.syncData.content,this.logService):null;if(!c){this.logService.info("Skipping initializing tasks because remote tasks does not exist.");return}if(!await this.isEmpty()){this.logService.info("Skipping initializing tasks because local tasks exist.");return}await this.fileService.writeFile(this.tasksResource,I.VSBuffer.fromString(c)),await this.updateLastSyncUserData(d)}async isEmpty(){return this.fileService.exists(this.tasksResource)}};e.TasksInitializer=f,e.TasksInitializer=f=Ee([G(0,_.IFileService),G(1,S.IUserDataProfilesService),G(2,A.IEnvironmentService),G(3,p.IUserDataSyncLogService),G(4,k.IStorageService),G(5,b.IUriIdentityService)],f);function w(l,d,c){if(l===null&&d===null&&c===null)return{content:null,hasLocalChanged:!1,hasRemoteChanged:!1,hasConflicts:!1};if(l===d)return{content:null,hasLocalChanged:!1,hasRemoteChanged:!1,hasConflicts:!1};const m=c!==l,y=c!==d;return!m&&!y?{content:null,hasLocalChanged:!1,hasRemoteChanged:!1,hasConflicts:!1}:m&&!y?{content:l,hasRemoteChanged:!0,hasLocalChanged:!1,hasConflicts:!1}:y&&!m?{content:d,hasLocalChanged:!0,hasRemoteChanged:!1,hasConflicts:!1}:{content:l,hasLocalChanged:!0,hasRemoteChanged:!0,hasConflicts:!0}}}),define(ce[122],le([0,1,42,18,15,13,19,21,27,17,39,235,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseUserDataProfilesManifest=e.stringifyLocalProfiles=e.UserDataProfilesManifestSynchroniser=void 0;let h=class extends P.AbstractSynchroniser{constructor(d,c,m,y,T,t,o,n,s,i,r,a,E){super({syncResource:"profiles",profile:d},c,y,T,t,o,n,r,a,s,i,E),this.userDataProfilesService=m,this.version=2,this.previewResource=this.extUri.joinPath(this.syncPreviewFolder,"profiles.json"),this.baseResource=this.previewResource.with({scheme:g.USER_DATA_SYNC_SCHEME,authority:"base"}),this.localResource=this.previewResource.with({scheme:g.USER_DATA_SYNC_SCHEME,authority:"local"}),this.remoteResource=this.previewResource.with({scheme:g.USER_DATA_SYNC_SCHEME,authority:"remote"}),this.acceptedResource=this.previewResource.with({scheme:g.USER_DATA_SYNC_SCHEME,authority:"accepted"}),this._register(m.onDidChangeProfiles(()=>this.triggerLocalChange()))}async getLastSyncedProfiles(){const d=await this.getLastSyncUserData();return d?.syncData?w(d.syncData):null}async getRemoteSyncedProfiles(d){const c=await this.getLastSyncUserData(),m=await this.getLatestRemoteUserData(d,c);return m?.syncData?w(m.syncData):null}async generateSyncPreview(d,c,m){if(!this.userDataProfilesService.isEnabled())throw new g.UserDataSyncError("Cannot sync profiles because they are disabled","LocalError");const y=d.syncData?w(d.syncData):null,T=c?.syncData?w(c.syncData):null,t=this.getLocalUserDataProfiles(),{local:o,remote:n}=(0,p.merge)(t,y,T,[]),s={local:o,remote:n,content:T?this.stringifyRemoteProfiles(T):null,localChange:o.added.length>0||o.removed.length>0||o.updated.length>0?2:0,remoteChange:n!==null?2:0},i=f(t,!1);return[{baseResource:this.baseResource,baseContent:T?this.stringifyRemoteProfiles(T):null,localResource:this.localResource,localContent:i,remoteResource:this.remoteResource,remoteContent:y?this.stringifyRemoteProfiles(y):null,remoteProfiles:y,previewResource:this.previewResource,previewResult:s,localChange:s.localChange,remoteChange:s.remoteChange,acceptedResource:this.acceptedResource}]}async hasRemoteChanged(d){const c=d?.syncData?w(d.syncData):null,m=this.getLocalUserDataProfiles(),{remote:y}=(0,p.merge)(m,c,c,[]);return!!y?.added.length||!!y?.removed.length||!!y?.updated.length}async getMergeResult(d,c){return{...d.previewResult,hasConflicts:!1}}async getAcceptResult(d,c,m,y){if(this.extUri.isEqual(c,this.localResource))return this.acceptLocal(d);if(this.extUri.isEqual(c,this.remoteResource))return this.acceptRemote(d);if(this.extUri.isEqual(c,this.previewResource))return d.previewResult;throw new Error(`Invalid Resource: ${c.toString()}`)}async acceptLocal(d){const c=this.getLocalUserDataProfiles(),m=(0,p.merge)(c,null,null,[]),{local:y,remote:T}=m;return{content:d.localContent,local:y,remote:T,localChange:y.added.length>0||y.removed.length>0||y.updated.length>0?2:0,remoteChange:T!==null?2:0}}async acceptRemote(d){const c=d.remoteContent?JSON.parse(d.remoteContent):null,m=[],y=[];for(const T of this.getLocalUserDataProfiles()){const t=c?.find(o=>o.id===T.id);t&&(m.push({id:T.id,name:T.name,collection:t.collection}),y.push(T))}if(c!==null){const T=(0,p.merge)(y,c,m,[]),{local:t,remote:o}=T;return{content:d.remoteContent,local:t,remote:o,localChange:t.added.length>0||t.removed.length>0||t.updated.length>0?2:0,remoteChange:o!==null?2:0}}else return{content:d.remoteContent,local:{added:[],removed:[],updated:[]},remote:null,localChange:0,remoteChange:0}}async applyResult(d,c,m,y){const{local:T,remote:t,localChange:o,remoteChange:n}=m[0][1];o===0&&n===0&&this.logService.info(`${this.syncResourceLogLabel}: No changes found during synchronizing profiles.`);const s=m[0][0].remoteProfiles||[];if(s.length+(t?.added.length??0)-(t?.removed.length??0)>20)throw new g.UserDataSyncError("Too many profiles to sync. Please remove some profiles and try again.","LocalTooManyProfiles");if(o!==0){await this.backupLocal(f(this.getLocalUserDataProfiles(),!1));const i=[];for(const r of T.added)i.push((async()=>{this.logService.trace(`${this.syncResourceLogLabel}: Creating '${r.name}' profile...`),await this.userDataProfilesService.createProfile(r.id,r.name,{shortName:r.shortName,useDefaultFlags:r.useDefaultFlags}),this.logService.info(`${this.syncResourceLogLabel}: Created profile '${r.name}'.`)})());for(const r of T.removed)i.push((async()=>{this.logService.trace(`${this.syncResourceLogLabel}: Removing '${r.name}' profile...`),await this.userDataProfilesService.removeProfile(r),this.logService.info(`${this.syncResourceLogLabel}: Removed profile '${r.name}'.`)})());for(const r of T.updated){const a=this.userDataProfilesService.profiles.find(E=>E.id===r.id);a?i.push((async()=>{this.logService.trace(`${this.syncResourceLogLabel}: Updating '${r.name}' profile...`),await this.userDataProfilesService.updateProfile(a,{name:r.name,shortName:r.shortName,useDefaultFlags:r.useDefaultFlags}),this.logService.info(`${this.syncResourceLogLabel}: Updated profile '${r.name}'.`)})()):this.logService.info(`${this.syncResourceLogLabel}: Could not find profile with id '${r.id}' to update.`)}await Promise.all(i)}if(n!==0){this.logService.trace(`${this.syncResourceLogLabel}: Updating remote profiles...`);const i=[],r=s.length+(t?.added.length??0)<=20;if(r)for(const a of t?.added||[]){const E=await this.userDataSyncStoreService.createCollection(this.syncHeaders);i.push(E),s.push({id:a.id,name:a.name,collection:E,shortName:a.shortName,useDefaultFlags:a.useDefaultFlags})}else this.logService.info(`${this.syncResourceLogLabel}: Could not create remote profiles as there are too many profiles.`);for(const a of t?.removed||[])s.splice(s.findIndex(({id:E})=>a.id===E),1);for(const a of t?.updated||[]){const E=s.find(({id:v})=>a.id===v);E&&s.splice(s.indexOf(E),1,{...E,id:a.id,name:a.name,shortName:a.shortName,useDefaultFlags:a.useDefaultFlags})}try{d=await this.updateRemoteProfiles(s,y?null:d.ref),this.logService.info(`${this.syncResourceLogLabel}: Updated remote profiles.${r&&t?.added.length?` Added: ${JSON.stringify(t.added.map(a=>a.name))}.`:""}${t?.updated.length?` Updated: ${JSON.stringify(t.updated.map(a=>a.name))}.`:""}${t?.removed.length?` Removed: ${JSON.stringify(t.removed.map(a=>a.name))}.`:""}`)}catch(a){if(i.length){this.logService.info(`${this.syncResourceLogLabel}: Failed to update remote profiles. Cleaning up added collections...`);for(const E of i)await this.userDataSyncStoreService.deleteCollection(E,this.syncHeaders)}throw a}for(const a of t?.removed||[])await this.userDataSyncStoreService.deleteCollection(a.collection,this.syncHeaders)}c?.ref!==d.ref&&(this.logService.trace(`${this.syncResourceLogLabel}: Updating last synchronized profiles...`),await this.updateLastSyncUserData(d),this.logService.info(`${this.syncResourceLogLabel}: Updated last synchronized profiles.`))}async updateRemoteProfiles(d,c){return this.updateRemoteUserData(this.stringifyRemoteProfiles(d),c)}async hasLocalData(){return this.getLocalUserDataProfiles().length>0}async resolveContent(d){if(this.extUri.isEqual(this.remoteResource,d)||this.extUri.isEqual(this.baseResource,d)||this.extUri.isEqual(this.localResource,d)||this.extUri.isEqual(this.acceptedResource,d)){const c=await this.resolvePreviewContent(d);return c&&(0,I.toFormattedString)(JSON.parse(c),{})}return null}getLocalUserDataProfiles(){return this.userDataProfilesService.profiles.filter(d=>!d.isDefault&&!d.isTransient)}stringifyRemoteProfiles(d){return JSON.stringify([...d].sort((c,m)=>c.name.localeCompare(m.name)))}};e.UserDataProfilesManifestSynchroniser=h,e.UserDataProfilesManifestSynchroniser=h=Ee([G(2,S.IUserDataProfilesService),G(3,_.IFileService),G(4,A.IEnvironmentService),G(5,k.IStorageService),G(6,g.IUserDataSyncStoreService),G(7,g.IUserDataSyncBackupStoreService),G(8,g.IUserDataSyncLogService),G(9,O.IConfigurationService),G(10,g.IUserDataSyncEnablementService),G(11,D.ITelemetryService),G(12,b.IUriIdentityService)],h);function f(l,d){const c=[...l].sort((m,y)=>m.name.localeCompare(y.name)).map(m=>({id:m.id,name:m.name}));return d?(0,I.toFormattedString)(c,{}):JSON.stringify(c)}e.stringifyLocalProfiles=f;function w(l){return JSON.parse(l.content)}e.parseUserDataProfilesManifest=w}),define(ce[253],le([0,1,5,14,61,2,22,18,15,13,17,24]),function(te,e,I,O,A,_,k,D,b,S,P,p){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncBackupStoreService=void 0;let g=class extends _.Disposable{constructor(f,w,l,d,c){super(),this.environmentService=f,this.fileService=w,this.configurationService=l,this.logService=d,this.userDataProfilesService=c,this.cleanUp()}async cleanUp(){for(const w of this.userDataProfilesService.profiles)for(const l of p.ALL_SYNC_RESOURCES)try{await this.cleanUpBackup(this.getResourceBackupHome(w,l))}catch(d){this.logService.error(d)}let f;try{f=await this.fileService.resolve(this.environmentService.userDataSyncHome)}catch(w){(0,S.toFileOperationResult)(w)!==1&&this.logService.error(w);return}if(f.children){for(const w of f.children)if(w.isDirectory&&!this.userDataProfilesService.profiles.some(l=>l.id===w.name))try{this.logService.info("Deleting non existing profile from backup",w.resource.path),await this.fileService.del(w.resource,{recursive:!0})}catch(l){this.logService.error(l)}}}async getAllRefs(f,w){const l=this.getResourceBackupHome(f,w);try{const d=await this.fileService.resolve(l);if(d.children)return d.children.filter(m=>m.isFile&&/^\d{8}T\d{6}(\.json)?$/.test(m.name)).sort().reverse().map(m=>({ref:m.name,created:this.getCreationTime(m)}))}catch(d){if((0,S.toFileOperationResult)(d)!==1)throw d}return[]}async resolveContent(f,w,l){const d=this.getResourceBackupHome(f,w),c=(0,k.joinPath)(d,l);try{return(await this.fileService.readFile(c)).value.toString()}catch(m){return this.logService.error(m),null}}async backup(f,w,l){const d=this.getResourceBackupHome(f,w),c=(0,k.joinPath)(d,`${(0,A.toLocalISOString)(new Date).replace(/-|:|\.\d+Z$/g,"")}.json`);try{await this.fileService.writeFile(c,O.VSBuffer.fromString(l))}catch(m){this.logService.error(m)}try{this.cleanUpBackup(d)}catch{}}getResourceBackupHome(f,w){return(0,k.joinPath)(this.environmentService.userDataSyncHome,...f.isDefault?[w]:[f.id,w])}async cleanUpBackup(f){try{try{if(!await this.fileService.exists(f))return}catch{return}const w=await this.fileService.resolve(f);if(w.children){const l=w.children.filter(y=>y.isFile&&/^\d{8}T\d{6}(\.json)?$/.test(y.name)).sort(),d=1e3*60*60*24*(this.configurationService.getValue("sync.localBackupDuration")||30);let c=l.filter(y=>Date.now()-this.getCreationTime(y)>d);const m=l.length-c.length;m<10&&(c=c.slice(10-m)),await I.Promises.settled(c.map(async y=>{this.logService.info("Deleting from backup",y.resource.path),await this.fileService.del(y.resource)}))}}catch(w){this.logService.error(w)}}getCreationTime(f){return f.ctime||new Date(parseInt(f.name.substring(0,4)),parseInt(f.name.substring(4,6))-1,parseInt(f.name.substring(6,8)),parseInt(f.name.substring(9,11)),parseInt(f.name.substring(11,13)),parseInt(f.name.substring(13,15))).getTime()}};e.UserDataSyncBackupStoreService=g,e.UserDataSyncBackupStoreService=g=Ee([G(0,b.IEnvironmentService),G(1,S.IFileService),G(2,D.IConfigurationService),G(3,p.IUserDataSyncLogService),G(4,P.IUserDataProfilesService)],g)}),define(ce[254],le([0,1,3,2,6,15,19,21,24]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncEnablementService=void 0;const S="sync.enable";let P=class extends O.Disposable{constructor(g,h,f,w){super(),this.storageService=g,this.telemetryService=h,this.environmentService=f,this.userDataSyncStoreManagementService=w,this._onDidChangeEnablement=new I.Emitter,this.onDidChangeEnablement=this._onDidChangeEnablement.event,this._onDidChangeResourceEnablement=new I.Emitter,this.onDidChangeResourceEnablement=this._onDidChangeResourceEnablement.event,this._register(g.onDidChangeValue(-1,void 0,this._register(new O.DisposableStore))(l=>this.onDidStorageChange(l)))}isEnabled(){switch(this.environmentService.sync){case"on":return!0;case"off":return!1}}canToggleEnablement(){return this.userDataSyncStoreManagementService.userDataSyncStore!==void 0&&this.environmentService.sync===void 0}setEnablement(g){g&&!this.canToggleEnablement()||(this.telemetryService.publicLog2(S,{enabled:g}),this.storageService.store(S,g,-1,1))}isResourceEnabled(g){return this.storageService.getBoolean((0,b.getEnablementKey)(g),-1,!0)}setResourceEnablement(g,h){if(this.isResourceEnabled(g)!==h){const f=(0,b.getEnablementKey)(g);this.storeResourceEnablement(f,h)}}getResourceSyncStateVersion(g){}storeResourceEnablement(g,h){this.storageService.store(g,h,-1,A.isWeb?0:1)}onDidStorageChange(g){if(S===g.key){this._onDidChangeEnablement.fire(this.isEnabled());return}const h=b.ALL_SYNC_RESOURCES.filter(f=>(0,b.getEnablementKey)(f)===g.key)[0];if(h){this._onDidChangeResourceEnablement.fire([h,this.isResourceEnabled(h)]);return}}};e.UserDataSyncEnablementService=P,e.UserDataSyncEnablementService=P=Ee([G(0,k.IStorageService),G(1,D.ITelemetryService),G(2,_.IEnvironmentService),G(3,b.IUserDataSyncStoreManagementService)],P)}),define(ce[81],le([0,1,3,2,6,28,176,15,13,4,23,45,19,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";var f;Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncMachinesService=e.isWebPlatform=e.IUserDataSyncMachinesService=void 0,e.IUserDataSyncMachinesService=(0,S.createDecorator)("IUserDataSyncMachinesService");const w="sync.currentMachineName",l="Safari",d="Chrome",c="Edge",m="Firefox",y="Android";function T(n){switch(n){case l:case d:case c:case m:case y:case(0,A.PlatformToString)(0):return!0}return!1}e.isWebPlatform=T;function t(){return A.isSafari?l:A.isChrome?d:A.isEdge?c:A.isFirefox?m:A.isAndroid?y:(0,A.PlatformToString)(A.isWeb?0:A.platform)}let o=class extends O.Disposable{static{f=this}static{this.VERSION=1}static{this.RESOURCE="machines"}constructor(s,i,r,a,E,v){super(),this.storageService=r,this.userDataSyncStoreService=a,this.logService=E,this.productService=v,this._onDidChange=this._register(new I.Emitter),this.onDidChange=this._onDidChange.event,this.userData=null,this.currentMachineIdPromise=(0,p.getServiceMachineId)(s,i,r)}async getMachines(s){const i=await this.currentMachineIdPromise;return(await this.readMachinesData(s)).machines.map(a=>({...a,isCurrent:a.id===i}))}async addCurrentMachine(s){const i=await this.currentMachineIdPromise,r=await this.readMachinesData(s);r.machines.some(({id:a})=>a===i)||(r.machines.push({id:i,name:this.computeCurrentMachineName(r.machines),platform:t()}),await this.writeMachinesData(r))}async removeCurrentMachine(s){const i=await this.currentMachineIdPromise,r=await this.readMachinesData(s),a=r.machines.filter(({id:E})=>E!==i);a.length!==r.machines.length&&(r.machines=a,await this.writeMachinesData(r))}async renameMachine(s,i,r){const a=await this.readMachinesData(r),E=a.machines.find(({id:v})=>v===s);if(E){E.name=i,await this.writeMachinesData(a);const v=await this.currentMachineIdPromise;s===v&&this.storageService.store(w,i,-1,1)}}async setEnablements(s){const i=await this.readMachinesData();for(const[r,a]of s){const E=i.machines.find(v=>v.id===r);E&&(E.disabled=a?void 0:!0)}await this.writeMachinesData(i)}computeCurrentMachineName(s){const i=this.storageService.get(w,-1);if(i)return i;const r=`${this.productService.embedderIdentifier?`${this.productService.embedderIdentifier} - `:""}${t()} (${this.productService.nameShort})`,a=new RegExp(`${(0,_.escapeRegExpCharacters)(r)}\\s#(\\d+)`);let E=0;for(const v of s){const u=a.exec(v.name),C=u?parseInt(u[1]):0;E=C>E?C:E}return`${r} #${E+1}`}async readMachinesData(s){this.userData=await this.readUserData(s);const i=this.parse(this.userData);if(i.version!==f.VERSION)throw new Error((0,k.localize)(0,null,this.productService.nameLong));return i}async writeMachinesData(s){const i=JSON.stringify(s),r=await this.userDataSyncStoreService.writeResource(f.RESOURCE,i,this.userData?.ref||null);this.userData={ref:r,content:i},this._onDidChange.fire()}async readUserData(s){if(this.userData){const i=s&&s.latest?s.latest[f.RESOURCE]:void 0;if(this.userData.ref===i)return this.userData;if(i===void 0&&this.userData.content===null)return this.userData}return this.userDataSyncStoreService.readResource(f.RESOURCE,this.userData)}parse(s){if(s.content!==null)try{return JSON.parse(s.content)}catch(i){this.logService.error(i)}return{version:f.VERSION,machines:[]}}};e.UserDataSyncMachinesService=o,e.UserDataSyncMachinesService=o=f=Ee([G(0,D.IEnvironmentService),G(1,b.IFileService),G(2,g.IStorageService),G(3,h.IUserDataSyncStoreService),G(4,h.IUserDataSyncLogService),G(5,P.IProductService)],o)}),define(ce[255],le([0,1,5,61,38,8,3,2,6,22,11,173,23,19,21,24,78,81]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataAutoSyncService=void 0;const c="sync.disableMachineEventually",m="sync.sessionId",y="sync.storeUrl",T="sync.productQuality";let t=class extends D.Disposable{get syncUrl(){const s=this.storageService.get(y,-1);return s?P.URI.parse(s):void 0}set syncUrl(s){s?this.storageService.store(y,s.toString(),-1,1):this.storageService.remove(y,-1)}get productQuality(){return this.storageService.get(T,-1)}set productQuality(s){s?this.storageService.store(T,s,-1,1):this.storageService.remove(T,-1)}constructor(s,i,r,a,E,v,u,C,U,F){super(),this.userDataSyncStoreManagementService=i,this.userDataSyncStoreService=r,this.userDataSyncEnablementService=a,this.userDataSyncService=E,this.logService=v,this.userDataSyncAccountService=u,this.telemetryService=C,this.userDataSyncMachinesService=U,this.storageService=F,this.autoSync=this._register(new D.MutableDisposable),this.successiveFailures=0,this.lastSyncTriggerTime=void 0,this.suspendUntilRestart=!1,this._onError=this._register(new k.Emitter),this.onError=this._onError.event,this.sources=[],this.syncTriggerDelayer=this._register(new I.ThrottledDelayer(this.getSyncTriggerDelayTime())),this.lastSyncUrl=this.syncUrl,this.syncUrl=i.userDataSyncStore?.url,this.previousProductQuality=this.productQuality,this.productQuality=s.quality,this.syncUrl&&(this.logService.info("Using settings sync service",this.syncUrl.toString()),this._register(i.onDidChangeUserDataSyncStore(()=>{(0,S.isEqual)(this.syncUrl,i.userDataSyncStore?.url)||(this.lastSyncUrl=this.syncUrl,this.syncUrl=i.userDataSyncStore?.url,this.syncUrl&&this.logService.info("Using settings sync service",this.syncUrl.toString()))})),this.userDataSyncEnablementService.isEnabled()?this.logService.info("Auto Sync is enabled."):this.logService.info("Auto Sync is disabled."),this.updateAutoSync(),this.hasToDisableMachineEventually()&&this.disableMachineEventually(),this._register(u.onDidChangeAccount(()=>this.updateAutoSync())),this._register(r.onDidChangeDonotMakeRequestsUntil(()=>this.updateAutoSync())),this._register(E.onDidChangeLocal(M=>this.triggerSync([M],!1,!1))),this._register(k.Event.filter(this.userDataSyncEnablementService.onDidChangeResourceEnablement,([,M])=>M)(()=>this.triggerSync(["resourceEnablement"],!1,!1))),this._register(this.userDataSyncStoreManagementService.onDidChangeUserDataSyncStore(()=>this.triggerSync(["userDataSyncStoreChanged"],!1,!1))))}updateAutoSync(){const{enabled:s,message:i}=this.isAutoSyncEnabled();s?this.autoSync.value===void 0&&(this.autoSync.value=new o(this.lastSyncUrl,1e3*60*5,this.userDataSyncStoreManagementService,this.userDataSyncStoreService,this.userDataSyncService,this.userDataSyncMachinesService,this.logService,this.telemetryService,this.storageService),this.autoSync.value.register(this.autoSync.value.onDidStartSync(()=>this.lastSyncTriggerTime=new Date().getTime())),this.autoSync.value.register(this.autoSync.value.onDidFinishSync(r=>this.onDidFinishSync(r))),this.startAutoSync()&&this.autoSync.value.start()):(this.syncTriggerDelayer.cancel(),this.autoSync.value!==void 0?(i&&this.logService.info(i),this.autoSync.clear()):i&&this.userDataSyncEnablementService.isEnabled()&&this.logService.info(i))}startAutoSync(){return!0}isAutoSyncEnabled(){return this.userDataSyncEnablementService.isEnabled()?this.userDataSyncAccountService.account?this.userDataSyncStoreService.donotMakeRequestsUntil?{enabled:!1,message:`Auto Sync: Suspended until ${(0,O.toLocalISOString)(this.userDataSyncStoreService.donotMakeRequestsUntil)} because server is not accepting requests until then.`}:this.suspendUntilRestart?{enabled:!1,message:"Auto Sync: Suspended until restart."}:{enabled:!0}:{enabled:!1,message:"Auto Sync: Suspended until auth token is available."}:{enabled:!1,message:"Auto Sync: Disabled."}}async turnOn(){this.stopDisableMachineEventually(),this.lastSyncUrl=this.syncUrl,this.updateEnablement(!0)}async turnOff(s,i,r){try{this.userDataSyncAccountService.account&&!r&&await this.userDataSyncMachinesService.removeCurrentMachine(),this.updateEnablement(!1),this.storageService.remove(m,-1),s?(this.telemetryService.publicLog2("sync/turnOffEveryWhere"),await this.userDataSyncService.reset()):await this.userDataSyncService.resetLocal()}catch(a){if(this.logService.error(a),i)this.updateEnablement(!1);else throw a}}updateEnablement(s){this.userDataSyncEnablementService.isEnabled()!==s&&(this.userDataSyncEnablementService.setEnablement(s),this.updateAutoSync())}hasProductQualityChanged(){return!!this.previousProductQuality&&!!this.productQuality&&this.previousProductQuality!==this.productQuality}async onDidFinishSync(s){if(!s){this.successiveFailures=0;return}const i=w.UserDataSyncError.toUserDataSyncError(s);i instanceof w.UserDataAutoSyncError&&this.telemetryService.publicLog2("autosync/error",{code:i.code,service:this.userDataSyncStoreManagementService.userDataSyncStore.url.toString()}),i.code==="SessionExpired"?(await this.turnOff(!1,!0),this.logService.info("Auto Sync: Turned off sync because current session is expired")):i.code==="TurnedOff"?(await this.turnOff(!1,!0),this.logService.info("Auto Sync: Turned off sync because sync is turned off in the cloud")):i.code==="LocalTooManyRequests"?(this.suspendUntilRestart=!0,this.logService.info("Auto Sync: Suspended sync because of making too many requests to server"),this.updateAutoSync()):i.code==="RemoteTooManyRequests"?(await this.turnOff(!1,!0,!0),this.disableMachineEventually(),this.logService.info("Auto Sync: Turned off sync because of making too many requests to server")):i.code==="MethodNotFound"?(await this.turnOff(!1,!0),this.logService.info("Auto Sync: Turned off sync because current client is making requests to server that are not supported")):i.code==="UpgradeRequired"||i.code==="Gone"?(await this.turnOff(!1,!0,!0),this.disableMachineEventually(),this.logService.info("Auto Sync: Turned off sync because current client is not compatible with server. Requires client upgrade.")):i.code==="IncompatibleLocalContent"?(await this.turnOff(!1,!0),this.logService.info(`Auto Sync: Turned off sync because server has ${i.resource} content with newer version than of client. Requires client upgrade.`)):i.code==="IncompatibleRemoteContent"?(await this.turnOff(!1,!0),this.logService.info(`Auto Sync: Turned off sync because server has ${i.resource} content with older version than of client. Requires server reset.`)):i.code==="ServiceChanged"||i.code==="DefaultServiceChanged"?b.isWeb&&i.code==="DefaultServiceChanged"&&!this.hasProductQualityChanged()?(await this.turnOff(!1,!0),this.logService.info("Auto Sync: Turned off sync because default sync service is changed.")):(await this.turnOff(!1,!0,!0),await this.turnOn(),this.logService.info("Auto Sync: Sync Service changed. Turned off auto sync, reset local state and turned on auto sync.")):(this.logService.error(i),this.successiveFailures++),this._onError.fire(i)}async disableMachineEventually(){this.storageService.store(c,!0,-1,1),await(0,I.timeout)(1e3*60*10),this.hasToDisableMachineEventually()&&(this.stopDisableMachineEventually(),!this.userDataSyncEnablementService.isEnabled()&&this.userDataSyncAccountService.account&&await this.userDataSyncMachinesService.removeCurrentMachine())}hasToDisableMachineEventually(){return this.storageService.getBoolean(c,-1,!1)}stopDisableMachineEventually(){this.storageService.remove(c,-1)}async triggerSync(s,i,r){if(this.autoSync.value===void 0)return this.syncTriggerDelayer.cancel();if(i&&this.lastSyncTriggerTime&&Math.round((new Date().getTime()-this.lastSyncTriggerTime)/1e3)<10){this.logService.debug("Auto Sync: Skipped. Limited to once per 10 seconds.");return}return this.sources.push(...s),this.syncTriggerDelayer.trigger(async()=>{this.logService.trace("activity sources",...this.sources);const a=this.userDataSyncAccountService.account?.authenticationProviderId||"";this.telemetryService.publicLog2("sync/triggered",{sources:this.sources,providerId:a}),this.sources=[],this.autoSync.value&&await this.autoSync.value.sync("Activity",r)},this.successiveFailures?this.getSyncTriggerDelayTime()*1*Math.min(Math.pow(2,this.successiveFailures),60):this.getSyncTriggerDelayTime())}getSyncTriggerDelayTime(){return 2e3}};e.UserDataAutoSyncService=t,e.UserDataAutoSyncService=t=Ee([G(0,g.IProductService),G(1,w.IUserDataSyncStoreManagementService),G(2,w.IUserDataSyncStoreService),G(3,w.IUserDataSyncEnablementService),G(4,w.IUserDataSyncService),G(5,w.IUserDataSyncLogService),G(6,l.IUserDataSyncAccountService),G(7,f.ITelemetryService),G(8,d.IUserDataSyncMachinesService),G(9,h.IStorageService)],t);class o extends D.Disposable{static{this.INTERVAL_SYNCING="Interval"}constructor(s,i,r,a,E,v,u,C,U){super(),this.lastSyncUrl=s,this.interval=i,this.userDataSyncStoreManagementService=r,this.userDataSyncStoreService=a,this.userDataSyncService=E,this.userDataSyncMachinesService=v,this.logService=u,this.telemetryService=C,this.storageService=U,this.intervalHandler=this._register(new D.MutableDisposable),this._onDidStartSync=this._register(new k.Emitter),this.onDidStartSync=this._onDidStartSync.event,this._onDidFinishSync=this._register(new k.Emitter),this.onDidFinishSync=this._onDidFinishSync.event,this.manifest=null}start(){this._register(this.onDidFinishSync(()=>this.waitUntilNextIntervalAndSync())),this._register((0,D.toDisposable)(()=>{this.syncPromise&&(this.syncPromise.cancel(),this.logService.info("Auto sync: Cancelled sync that is in progress"),this.syncPromise=void 0),this.syncTask?.stop(),this.logService.info("Auto Sync: Stopped")})),this.sync(o.INTERVAL_SYNCING,!1)}waitUntilNextIntervalAndSync(){this.intervalHandler.value=(0,I.disposableTimeout)(()=>this.sync(o.INTERVAL_SYNCING,!1),this.interval)}sync(s,i){const r=(0,I.createCancelablePromise)(async a=>{if(this.syncPromise)try{this.logService.debug("Auto Sync: Waiting until sync is finished."),await this.syncPromise}catch(E){if((0,_.isCancellationError)(E))return}return this.doSync(s,i,a)});return this.syncPromise=r,this.syncPromise.finally(()=>this.syncPromise=void 0),this.syncPromise}hasSyncServiceChanged(){return this.lastSyncUrl!==void 0&&!(0,S.isEqual)(this.lastSyncUrl,this.userDataSyncStoreManagementService.userDataSyncStore?.url)}async hasDefaultServiceChanged(){const s=await this.userDataSyncStoreManagementService.getPreviousUserDataSyncStore(),i=this.userDataSyncStoreManagementService.userDataSyncStore;return!!i&&!!s&&(!(0,S.isEqual)(i.defaultUrl,s.defaultUrl)||!(0,S.isEqual)(i.insidersUrl,s.insidersUrl)||!(0,S.isEqual)(i.stableUrl,s.stableUrl))}async doSync(s,i,r){this.logService.info(`Auto Sync: Triggered by ${s}`),this._onDidStartSync.fire();let a;try{await this.createAndRunSyncTask(i,r)}catch(E){if(this.logService.error(E),a=E,w.UserDataSyncError.toUserDataSyncError(E).code==="MethodNotFound")try{this.logService.info("Auto Sync: Client is making invalid requests. Cleaning up data..."),await this.userDataSyncService.cleanUpRemoteData(),this.logService.info("Auto Sync: Retrying sync..."),await this.createAndRunSyncTask(i,r),a=void 0}catch(v){this.logService.error(v),a=v}}this._onDidFinishSync.fire(a)}async createAndRunSyncTask(s,i){if(this.syncTask=await this.userDataSyncService.createSyncTask(this.manifest,s),i.isCancellationRequested)return;if(this.manifest=this.syncTask.manifest,this.manifest===null&&await this.userDataSyncService.hasPreviouslySynced())throw this.hasSyncServiceChanged()?await this.hasDefaultServiceChanged()?new w.UserDataAutoSyncError((0,p.localize)(0,null),"DefaultServiceChanged"):new w.UserDataAutoSyncError((0,p.localize)(1,null),"ServiceChanged"):new w.UserDataAutoSyncError((0,p.localize)(2,null),"TurnedOff");const r=this.storageService.get(m,-1);if(r&&this.manifest&&r!==this.manifest.session)throw this.hasSyncServiceChanged()?await this.hasDefaultServiceChanged()?new w.UserDataAutoSyncError((0,p.localize)(3,null),"DefaultServiceChanged"):new w.UserDataAutoSyncError((0,p.localize)(4,null),"ServiceChanged"):new w.UserDataAutoSyncError((0,p.localize)(5,null),"SessionExpired");const a=await this.userDataSyncMachinesService.getMachines(this.manifest||void 0);if(i.isCancellationRequested)return;const E=a.find(u=>u.isCurrent);if(E?.disabled)throw new w.UserDataAutoSyncError((0,p.localize)(6,null),"TurnedOff");const v=new Date().getTime();if(await this.syncTask.run(),this.telemetryService.publicLog2("settingsSync:sync",{duration:new Date().getTime()-v}),this.manifest===null)try{this.manifest=await this.userDataSyncStoreService.manifest(null)}catch(u){throw new w.UserDataAutoSyncError((0,A.toErrorMessage)(u),u instanceof w.UserDataSyncError?u.code:"Unknown")}this.manifest&&this.manifest.session!==r&&this.storageService.store(m,this.manifest.session,-1,1),!i.isCancellationRequested&&(E||await this.userDataSyncMachinesService.addCurrentMachine(this.manifest||void 0))}register(s){return super._register(s)}}}),define(ce[256],le([0,1,11,177,15,13,45,19,27,24,17,39,120,119,118,18,121,116,117,4,122,42]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T){"use strict";var t;Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncResourceProviderService=void 0;let o=class{static{t=this}static{this.NOT_EXISTING_RESOURCE="not-existing-resource"}static{this.REMOTE_BACKUP_AUTHORITY="remote-backup"}static{this.LOCAL_BACKUP_AUTHORITY="local-backup"}constructor(s,i,r,a,E,v,u,C,U,F){this.userDataSyncStoreService=s,this.userDataSyncBackupStoreService=i,this.logService=r,this.environmentService=E,this.storageService=v,this.fileService=u,this.userDataProfilesService=C,this.configurationService=U,this.instantiationService=F,this.extUri=a.extUri}async getRemoteSyncedProfiles(){const s=await this.userDataSyncStoreService.readResource("profiles",null,void 0);if(s.content){const i=this.parseSyncData(s.content,"profiles");return(0,y.parseUserDataProfilesManifest)(i)}return[]}async getRemoteSyncResourceHandles(s,i){return(await this.userDataSyncStoreService.getAllResourceRefs(s,i?.collection)).map(({created:a,ref:E})=>({created:a,uri:this.toUri({remote:!0,syncResource:s,profile:i?.id??this.userDataProfilesService.defaultProfile.id,collection:i?.collection,ref:E,node:void 0})}))}async getLocalSyncResourceHandles(s,i){return(await this.userDataSyncBackupStoreService.getAllRefs(i,s)).map(({created:a,ref:E})=>({created:a,uri:this.toUri({remote:!1,syncResource:s,profile:i.id,collection:void 0,ref:E,node:void 0})}))}resolveUserDataSyncResource({uri:s}){const i=this.resolveUri(s),r=i?this.userDataProfilesService.profiles.find(a=>a.id===i.profile):void 0;return i&&r?{profile:r,syncResource:i?.syncResource}:void 0}async getAssociatedResources({uri:s}){const i=this.resolveUri(s);if(!i)return[];const r=this.userDataProfilesService.profiles.find(a=>a.id===i.profile);switch(i.syncResource){case"settings":return this.getSettingsAssociatedResources(s,r);case"keybindings":return this.getKeybindingsAssociatedResources(s,r);case"tasks":return this.getTasksAssociatedResources(s,r);case"snippets":return this.getSnippetsAssociatedResources(s,r);case"globalState":return this.getGlobalStateAssociatedResources(s,r);case"extensions":return this.getExtensionsAssociatedResources(s,r);case"profiles":return this.getProfilesAssociatedResources(s,r);case"workspaceState":return[]}}async getMachineId({uri:s}){const i=this.resolveUri(s);if(i){if(i.remote){if(i.ref){const{content:r}=await this.getUserData(i.syncResource,i.ref,i.collection);if(r)return this.parseSyncData(r,i.syncResource)?.machineId}return}return(0,k.getServiceMachineId)(this.environmentService,this.fileService,this.storageService)}}async resolveContent(s){const i=this.resolveUri(s);if(!i||i.node===t.NOT_EXISTING_RESOURCE)return null;if(i.ref){const r=await this.getContentFromStore(i.remote,i.syncResource,i.profile,i.collection,i.ref);return i.node&&r?this.resolveNodeContent(i.syncResource,r,i.node):r}return!i.remote&&!i.node?this.resolveLatestContent(i.syncResource,i.profile):null}async getContentFromStore(s,i,r,a,E){if(s){const{content:u}=await this.getUserData(i,E,a);return u}const v=this.userDataProfilesService.profiles.find(u=>u.id===r);return v?this.userDataSyncBackupStoreService.resolveContent(v,i,E):null}resolveNodeContent(s,i,r){const a=this.parseSyncData(i,s);switch(s){case"settings":return this.resolveSettingsNodeContent(a,r);case"keybindings":return this.resolveKeybindingsNodeContent(a,r);case"tasks":return this.resolveTasksNodeContent(a,r);case"snippets":return this.resolveSnippetsNodeContent(a,r);case"globalState":return this.resolveGlobalStateNodeContent(a,r);case"extensions":return this.resolveExtensionsNodeContent(a,r);case"profiles":return this.resolveProfileNodeContent(a,r);case"workspaceState":return null}}async resolveLatestContent(s,i){const r=this.userDataProfilesService.profiles.find(a=>a.id===i);if(!r)return null;switch(s){case"globalState":return this.resolveLatestGlobalStateContent(r);case"extensions":return this.resolveLatestExtensionsContent(r);case"profiles":return this.resolveLatestProfilesContent(r);case"settings":return null;case"keybindings":return null;case"tasks":return null;case"snippets":return null;case"workspaceState":return null}}getSettingsAssociatedResources(s,i){const r=this.extUri.joinPath(s,"settings.json"),a=i?i.settingsResource:this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);return[{resource:r,comparableResource:a}]}resolveSettingsNodeContent(s,i){switch(i){case"settings.json":return(0,h.parseSettingsSyncContent)(s.content).settings}return null}getKeybindingsAssociatedResources(s,i){const r=this.extUri.joinPath(s,"keybindings.json"),a=i?i.keybindingsResource:this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);return[{resource:r,comparableResource:a}]}resolveKeybindingsNodeContent(s,i){switch(i){case"keybindings.json":return(0,f.getKeybindingsContentFromSyncContent)(s.content,!!this.configurationService.getValue(S.CONFIG_SYNC_KEYBINDINGS_PER_PLATFORM),this.logService)}return null}getTasksAssociatedResources(s,i){const r=this.extUri.joinPath(s,"tasks.json"),a=i?i.tasksResource:this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);return[{resource:r,comparableResource:a}]}resolveTasksNodeContent(s,i){switch(i){case"tasks.json":return(0,l.getTasksContentFromSyncContent)(s.content,this.logService)}return null}async getSnippetsAssociatedResources(s,i){const r=await this.resolveContent(s);if(r){const a=this.parseSyncData(r,"snippets");if(a){const E=(0,g.parseSnippets)(a),v=[];for(const u of Object.keys(E)){const C=this.extUri.joinPath(s,u),U=i?this.extUri.joinPath(i.snippetsHome,u):this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);v.push({resource:C,comparableResource:U})}return v}}return[]}resolveSnippetsNodeContent(s,i){return(0,g.parseSnippets)(s)[i]||null}getExtensionsAssociatedResources(s,i){const r=this.extUri.joinPath(s,"extensions.json"),a=i?this.toUri({remote:!1,syncResource:"extensions",profile:i.id,collection:void 0,ref:void 0,node:void 0}):this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);return[{resource:r,comparableResource:a}]}resolveExtensionsNodeContent(s,i){switch(i){case"extensions.json":return(0,d.stringify)((0,d.parseExtensions)(s),!0)}return null}async resolveLatestExtensionsContent(s){const{localExtensions:i}=await this.instantiationService.createInstance(d.LocalExtensionsProvider).getLocalExtensions(s);return(0,d.stringify)(i,!0)}getGlobalStateAssociatedResources(s,i){const r=this.extUri.joinPath(s,"globalState.json"),a=i?this.toUri({remote:!1,syncResource:"globalState",profile:i.id,collection:void 0,ref:void 0,node:void 0}):this.extUri.joinPath(s,t.NOT_EXISTING_RESOURCE);return[{resource:r,comparableResource:a}]}resolveGlobalStateNodeContent(s,i){switch(i){case"globalState.json":return(0,c.stringify)(JSON.parse(s.content),!0)}return null}async resolveLatestGlobalStateContent(s){const i=await this.instantiationService.createInstance(c.LocalGlobalStateProvider).getLocalGlobalState(s);return(0,c.stringify)(i,!0)}getProfilesAssociatedResources(s,i){const r=this.extUri.joinPath(s,"profiles.json"),a=this.toUri({remote:!1,syncResource:"profiles",profile:this.userDataProfilesService.defaultProfile.id,collection:void 0,ref:void 0,node:void 0});return[{resource:r,comparableResource:a}]}resolveProfileNodeContent(s,i){switch(i){case"profiles.json":return(0,T.toFormattedString)(JSON.parse(s.content),{})}return null}async resolveLatestProfilesContent(s){return(0,y.stringifyLocalProfiles)(this.userDataProfilesService.profiles.filter(i=>!i.isDefault&&!i.isTransient),!0)}toUri(s){const i=s.remote?t.REMOTE_BACKUP_AUTHORITY:t.LOCAL_BACKUP_AUTHORITY,r=[s.syncResource,s.profile];return s.collection&&r.push(`collection:${s.collection}`),s.ref&&r.push(`ref:${s.ref}`),s.node&&r.push(s.node),this.extUri.joinPath(I.URI.from({scheme:S.USER_DATA_SYNC_SCHEME,authority:i,path:"/"}),...r)}resolveUri(s){if(s.scheme!==S.USER_DATA_SYNC_SCHEME||s.authority!==t.LOCAL_BACKUP_AUTHORITY&&s.authority!==t.REMOTE_BACKUP_AUTHORITY)return;const i=[];for(;s.path!=="/";)i.unshift(this.extUri.basename(s)),s=this.extUri.dirname(s);if(i.length<2)return;const r=s.authority===t.REMOTE_BACKUP_AUTHORITY,a=i.shift(),E=i.shift();let v,u,C;for(;i.length;){const U=i.shift();U.startsWith("collection:")?v=U.substring(11):U.startsWith("ref:")?u=U.substring(4):C=U}return{remote:r,syncResource:a,profile:E,collection:v,ref:u,node:C}}parseSyncData(s,i){try{const r=JSON.parse(s);if((0,p.isSyncData)(r))return r}catch(r){this.logService.error(r)}throw new S.UserDataSyncError((0,O.localize)(0,null),"IncompatibleRemoteContent",i)}async getUserData(s,i,r){const a=await this.userDataSyncStoreService.resolveResourceContent(s,i,r);return{ref:i,content:a}}};e.UserDataSyncResourceProviderService=o,e.UserDataSyncResourceProviderService=o=t=Ee([G(0,S.IUserDataSyncStoreService),G(1,S.IUserDataSyncBackupStoreService),G(2,S.IUserDataSyncLogService),G(3,b.IUriIdentityService),G(4,A.IEnvironmentService),G(5,D.IStorageService),G(6,_.IFileService),G(7,P.IUserDataProfilesService),G(8,w.IConfigurationService),G(9,m.IInstantiationService)],o)}),define(ce[257],le([0,1,20,5,25,38,3,2,22,12,32,18,29,4,19,21,17,116,117,118,119,120,121,122,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncService=void 0;const s="sync.lastSyncTime";let i=class extends D.Disposable{get status(){return this._status}get conflicts(){return this._conflicts}get lastSyncTime(){return this._lastSyncTime}constructor(u,C,U,F,M,z,V,J,H){super(),this.userDataSyncStoreService=u,this.userDataSyncStoreManagementService=C,this.instantiationService=U,this.logService=F,this.telemetryService=M,this.storageService=z,this.userDataSyncEnablementService=V,this.userDataProfilesService=J,this.userDataSyncResourceProviderService=H,this._status="uninitialized",this._onDidChangeStatus=this._register(new k.Emitter),this.onDidChangeStatus=this._onDidChangeStatus.event,this._onDidChangeLocal=this._register(new k.Emitter),this.onDidChangeLocal=this._onDidChangeLocal.event,this._conflicts=[],this._onDidChangeConflicts=this._register(new k.Emitter),this.onDidChangeConflicts=this._onDidChangeConflicts.event,this._syncErrors=[],this._onSyncErrors=this._register(new k.Emitter),this.onSyncErrors=this._onSyncErrors.event,this._lastSyncTime=void 0,this._onDidChangeLastSyncTime=this._register(new k.Emitter),this.onDidChangeLastSyncTime=this._onDidChangeLastSyncTime.event,this._onDidResetLocal=this._register(new k.Emitter),this.onDidResetLocal=this._onDidResetLocal.event,this._onDidResetRemote=this._register(new k.Emitter),this.onDidResetRemote=this._onDidResetRemote.event,this.activeProfileSynchronizers=new Map,this._status=C.userDataSyncStore?"idle":"uninitialized",this._lastSyncTime=this.storageService.getNumber(s,-1,void 0),this._register((0,D.toDisposable)(()=>this.clearActiveProfileSynchronizers()))}async createSyncTask(u,C){this.checkEnablement(),this.logService.info("Sync started.");const U=new Date().getTime(),F=(0,P.generateUuid)();try{const J=(0,n.createSyncHeaders)(F);C&&(J["Cache-Control"]="no-cache"),u=await this.userDataSyncStoreService.manifest(u,J)}catch(J){const H=n.UserDataSyncError.toUserDataSyncError(J);throw E(H,F,this.userDataSyncStoreManagementService,this.telemetryService),H}const M=!1,z=this;let V;return{manifest:u,async run(){if(M)throw new Error("Can run a task only once");V=(0,O.createCancelablePromise)(J=>z.sync(u,!1,F,J)),await V.finally(()=>V=void 0),z.logService.info(`Sync done. Took ${new Date().getTime()-U}ms`),z.updateLastSyncTime()},stop(){return V?.cancel(),z.stop()}}}async createManualSyncTask(){if(this.checkEnablement(),this.userDataSyncEnablementService.isEnabled())throw new n.UserDataSyncError("Cannot start manual sync when sync is enabled","LocalError");this.logService.info("Sync started.");const u=new Date().getTime(),C=(0,P.generateUuid)(),U=(0,n.createSyncHeaders)(C);let F;try{F=await this.userDataSyncStoreService.manifest(null,U)}catch(V){const J=n.UserDataSyncError.toUserDataSyncError(V);throw E(J,C,this.userDataSyncStoreManagementService,this.telemetryService),J}await this.resetLocal();const M=this,z=new A.CancellationTokenSource;return{id:C,async merge(){return M.sync(F,!0,C,z.token)},async apply(){try{try{await M.applyManualSync(F,C,z.token)}catch(V){if(n.UserDataSyncError.toUserDataSyncError(V).code==="MethodNotFound")M.logService.info("Client is making invalid requests. Cleaning up data..."),await M.cleanUpRemoteData(),M.logService.info("Applying manual sync again..."),await M.applyManualSync(F,C,z.token);else throw V}}catch(V){throw M.logService.error(V),V}M.logService.info(`Sync done. Took ${new Date().getTime()-u}ms`),M.updateLastSyncTime()},async stop(){z.cancel(),await M.stop(),await M.resetLocal()}}}async sync(u,C,U,F){this._syncErrors=[];try{this.status!=="hasConflicts"&&this.setStatus("syncing");const M=this.getOrCreateActiveProfileSynchronizer(this.userDataProfilesService.defaultProfile,void 0);this._syncErrors.push(...await this.syncProfile(M,u,C,U,F));const z=M.enabled.find(V=>V.resource==="profiles");if(z){const V=await z.getLastSyncedProfiles()||[];if(F.isCancellationRequested)return;await this.syncRemoteProfiles(V,u,C,U,F)}}finally{this._onSyncErrors.fire(this._syncErrors)}}async syncRemoteProfiles(u,C,U,F,M){for(const z of u){if(M.isCancellationRequested)return;const V=this.userDataProfilesService.profiles.find(H=>H.id===z.id);if(!V){this.logService.error(`Profile with id:${z.id} and name: ${z.name} does not exist locally to sync.`);continue}this.logService.info("Syncing profile.",z.name);const J=this.getOrCreateActiveProfileSynchronizer(V,z);this._syncErrors.push(...await this.syncProfile(J,C,U,F,M))}for(const[z,V]of this.activeProfileSynchronizers.entries())this.userDataProfilesService.profiles.some(J=>J.id===V[0].profile.id)||(V[1].dispose(),this.activeProfileSynchronizers.delete(z))}async applyManualSync(u,C,U){const F=this.getActiveProfileSynchronizers();for(const H of F){if(U.isCancellationRequested)return;await H.apply(C,U)}const M=F.find(H=>H.profile.isDefault);if(!M)return;const z=M.enabled.find(H=>H.resource==="profiles");if(!z)return;const J=(await z.getRemoteSyncedProfiles(u?.latest??null)||[]).filter(H=>F.every(Y=>Y.profile.id!==H.id));J.length&&await this.syncRemoteProfiles(J,u,!1,C,U)}async syncProfile(u,C,U,F,M){return(await u.sync(C,U,F,M)).map(([V,J])=>({profile:u.profile,syncResource:V,error:J}))}async stop(){this.status!=="idle"&&await Promise.allSettled(this.getActiveProfileSynchronizers().map(u=>u.stop()))}async resolveContent(u){const C=await this.userDataSyncResourceProviderService.resolveContent(u);if(C)return C;for(const U of this.getActiveProfileSynchronizers())for(const F of U.enabled){const M=await F.resolveContent(u);if(M)return M}return null}async replace(u){this.checkEnablement();const C=this.userDataSyncResourceProviderService.resolveUserDataSyncResource(u);if(!C)return;const U=await this.resolveContent(u.uri);U&&await this.performAction(C.profile,async F=>{if(C.syncResource===F.resource)return await F.replace(U),!0})}async accept(u,C,U,F){this.checkEnablement(),await this.performAction(u.profile,async M=>{if(u.syncResource===M.resource)return await M.accept(C,U),F&&await M.apply((0,S.isBoolean)(F)?!1:F.force,(0,n.createSyncHeaders)((0,P.generateUuid)())),!0})}getRemoteProfiles(){return this.userDataSyncResourceProviderService.getRemoteSyncedProfiles()}getRemoteSyncResourceHandles(u,C){return this.userDataSyncResourceProviderService.getRemoteSyncResourceHandles(u,C)}async getLocalSyncResourceHandles(u,C){return this.userDataSyncResourceProviderService.getLocalSyncResourceHandles(u,C??this.userDataProfilesService.defaultProfile)}async getAssociatedResources(u){return this.userDataSyncResourceProviderService.getAssociatedResources(u)}async getMachineId(u){return this.userDataSyncResourceProviderService.getMachineId(u)}async hasLocalData(){return!!await this.performAction(this.userDataProfilesService.defaultProfile,async C=>{if(C.resource!=="globalState"&&await C.hasLocalData())return!0})}async hasPreviouslySynced(){return!!await this.performAction(this.userDataProfilesService.defaultProfile,async C=>{if(await C.hasPreviouslySynced())return!0})}async reset(){this.checkEnablement(),await this.resetRemote(),await this.resetLocal()}async resetRemote(){this.checkEnablement();try{await this.userDataSyncStoreService.clear(),this.logService.info("Cleared data on server")}catch(u){this.logService.error(u)}this._onDidResetRemote.fire()}async resetLocal(){this.checkEnablement(),this._lastSyncTime=void 0,this.storageService.remove(s,-1);for(const[u]of this.activeProfileSynchronizers.values())try{await u.resetLocal()}catch(C){this.logService.error(C)}this.clearActiveProfileSynchronizers(),this._onDidResetLocal.fire(),this.logService.info("Did reset the local sync state.")}async cleanUpRemoteData(){const u=await this.userDataSyncResourceProviderService.getRemoteSyncedProfiles(),C=u.map(z=>z.collection),U=await this.userDataSyncStoreService.getAllCollections(),F=U.filter(z=>!C.includes(z));F.length&&(this.logService.info(`Deleting ${F.length} redundant collections on server`),await Promise.allSettled(F.map(z=>this.userDataSyncStoreService.deleteCollection(z))),this.logService.info("Deleted redundant collections on server"));const M=u.filter(z=>U.includes(z.collection));if(M.length!==u.length){const z=this.instantiationService.createInstance(o.UserDataProfilesManifestSynchroniser,this.userDataProfilesService.defaultProfile,void 0);try{this.logService.info("Resetting the last synced state of profiles"),await z.resetLocal(),this.logService.info("Did reset the last synced state of profiles"),this.logService.info("Updating remote profiles with invalid collections on server"),await z.updateRemoteProfiles(M,null),this.logService.info("Updated remote profiles on server")}finally{z.dispose()}}}async performAction(u,C){const U=new D.DisposableStore;try{const F=this.activeProfileSynchronizers.get(u.id);if(F){const H=await this.performActionWithProfileSynchronizer(F[0],C,U);return(0,S.isUndefined)(H)?null:H}if(u.isDefault){const H=U.add(this.instantiationService.createInstance(r,u,void 0)),Y=await this.performActionWithProfileSynchronizer(H,C,U);return(0,S.isUndefined)(Y)?null:Y}if(this.userDataProfilesService.isEnabled())return null;const M=U.add(this.instantiationService.createInstance(o.UserDataProfilesManifestSynchroniser,u,void 0)),z=await this.userDataSyncStoreService.manifest(null),J=(await M.getRemoteSyncedProfiles(z?.latest??null)||[]).find(H=>H.id===u.id);if(J){const H=U.add(this.instantiationService.createInstance(r,u,J.collection)),Y=await this.performActionWithProfileSynchronizer(H,C,U);return(0,S.isUndefined)(Y)?null:Y}return null}finally{U.dispose()}}async performActionWithProfileSynchronizer(u,C,U){const F=[...u.enabled,...u.disabled.reduce((M,z)=>(z!=="workspaceState"&&M.push(U.add(u.createSynchronizer(z))),M),[])];for(const M of F){const z=await C(M);if(!(0,S.isUndefined)(z))return z}}setStatus(u){const C=this._status;this._status!==u&&(this._status=u,this._onDidChangeStatus.fire(u),C==="hasConflicts"&&this.updateLastSyncTime())}updateConflicts(){const u=this.getActiveProfileSynchronizers().map(C=>C.conflicts).flat();(0,I.equals)(this._conflicts,u,(C,U)=>C.profile.id===U.profile.id&&C.syncResource===U.syncResource&&(0,I.equals)(C.conflicts,U.conflicts,(F,M)=>(0,b.isEqual)(F.previewResource,M.previewResource)))||(this._conflicts=u,this._onDidChangeConflicts.fire(u))}updateLastSyncTime(){this.status==="idle"&&(this._lastSyncTime=new Date().getTime(),this.storageService.store(s,this._lastSyncTime,-1,1),this._onDidChangeLastSyncTime.fire(this._lastSyncTime))}getOrCreateActiveProfileSynchronizer(u,C){let U=this.activeProfileSynchronizers.get(u.id);if(U&&U[0].collection!==C?.collection&&(this.logService.error("Profile synchronizer collection does not match with the remote sync profile collection"),U[1].dispose(),U=void 0,this.activeProfileSynchronizers.delete(u.id)),!U){const F=new D.DisposableStore,M=F.add(this.instantiationService.createInstance(r,u,C?.collection));F.add(M.onDidChangeStatus(z=>this.setStatus(z))),F.add(M.onDidChangeConflicts(z=>this.updateConflicts())),F.add(M.onDidChangeLocal(z=>this._onDidChangeLocal.fire(z))),this.activeProfileSynchronizers.set(u.id,U=[M,F])}return U[0]}getActiveProfileSynchronizers(){const u=[];for(const[C]of this.activeProfileSynchronizers.values())u.push(C);return u}clearActiveProfileSynchronizers(){this.activeProfileSynchronizers.forEach(([,u])=>u.dispose()),this.activeProfileSynchronizers.clear()}checkEnablement(){if(!this.userDataSyncStoreManagementService.userDataSyncStore)throw new Error("Not enabled")}};e.UserDataSyncService=i,e.UserDataSyncService=i=Ee([G(0,n.IUserDataSyncStoreService),G(1,n.IUserDataSyncStoreManagementService),G(2,h.IInstantiationService),G(3,n.IUserDataSyncLogService),G(4,w.ITelemetryService),G(5,f.IStorageService),G(6,n.IUserDataSyncEnablementService),G(7,l.IUserDataProfilesService),G(8,n.IUserDataSyncResourceProviderService)],i);let r=class extends D.Disposable{get enabled(){return this._enabled.sort((u,C)=>u[1]-C[1]).map(([u])=>u)}get disabled(){return n.ALL_SYNC_RESOURCES.filter(u=>!this.userDataSyncEnablementService.isResourceEnabled(u))}get status(){return this._status}get conflicts(){return this._conflicts}constructor(u,C,U,F,M,z,V,J,H,Y){super(),this.profile=u,this.collection=C,this.userDataSyncEnablementService=U,this.instantiationService=F,this.extensionGalleryService=M,this.userDataSyncStoreManagementService=z,this.telemetryService=V,this.logService=J,this.userDataProfilesService=H,this.configurationService=Y,this._enabled=[],this._status="idle",this._onDidChangeStatus=this._register(new k.Emitter),this.onDidChangeStatus=this._onDidChangeStatus.event,this._onDidChangeLocal=this._register(new k.Emitter),this.onDidChangeLocal=this._onDidChangeLocal.event,this._conflicts=[],this._onDidChangeConflicts=this._register(new k.Emitter),this.onDidChangeConflicts=this._onDidChangeConflicts.event,this._register(U.onDidChangeResourceEnablement(([B,K])=>this.onDidChangeResourceEnablement(B,K))),this._register((0,D.toDisposable)(()=>this._enabled.splice(0,this._enabled.length).forEach(([,,B])=>B.dispose())));for(const B of n.ALL_SYNC_RESOURCES)U.isResourceEnabled(B)&&this.registerSynchronizer(B)}onDidChangeResourceEnablement(u,C){C?this.registerSynchronizer(u):this.deRegisterSynchronizer(u)}registerSynchronizer(u){if(this._enabled.some(([M])=>M.resource===u))return;if(u==="extensions"&&!this.extensionGalleryService.isEnabled()){this.logService.info("Skipping extensions sync because gallery is not configured");return}if(u==="profiles"&&(!this.profile.isDefault||!this.userDataProfilesService.isEnabled())||u==="workspaceState")return;if(u!=="profiles"&&this.profile.useDefaultFlags?.[u]){this.logService.debug(`Skipping syncing ${u} in ${this.profile.name} because it is already synced by default profile`);return}const C=new D.DisposableStore,U=C.add(this.createSynchronizer(u));C.add(U.onDidChangeStatus(()=>this.updateStatus())),C.add(U.onDidChangeConflicts(()=>this.updateConflicts())),C.add(U.onDidChangeLocal(()=>this._onDidChangeLocal.fire(u)));const F=this.getOrder(u);this._enabled.push([U,F,C])}deRegisterSynchronizer(u){const C=this._enabled.findIndex(([U])=>U.resource===u);if(C!==-1){const[[U,,F]]=this._enabled.splice(C,1);F.dispose(),this.updateStatus(),Promise.allSettled([U.stop(),U.resetLocal()]).then(null,M=>this.logService.error(M))}}createSynchronizer(u){switch(u){case"settings":return this.instantiationService.createInstance(y.SettingsSynchroniser,this.profile,this.collection);case"keybindings":return this.instantiationService.createInstance(m.KeybindingsSynchroniser,this.profile,this.collection);case"snippets":return this.instantiationService.createInstance(T.SnippetsSynchroniser,this.profile,this.collection);case"tasks":return this.instantiationService.createInstance(t.TasksSynchroniser,this.profile,this.collection);case"globalState":return this.instantiationService.createInstance(c.GlobalStateSynchroniser,this.profile,this.collection);case"extensions":return this.instantiationService.createInstance(d.ExtensionsSynchroniser,this.profile,this.collection);case"profiles":return this.instantiationService.createInstance(o.UserDataProfilesManifestSynchroniser,this.profile,this.collection)}}async sync(u,C,U,F){if(F.isCancellationRequested)return[];const M=this.enabled;if(!M.length)return[];try{const z=[],V=(0,n.createSyncHeaders)(U),J=(this.collection?u?.collections?.[this.collection]?.latest:u?.latest)??null,H=C?await this.getUserDataSyncConfiguration(J):{};for(const Y of M){if(F.isCancellationRequested)return[];if(!this.userDataSyncEnablementService.isResourceEnabled(Y.resource))return[];try{if(C){const B=await Y.preview(J,H,V);if(B)for(const K of B.resourcePreviews)(K.localChange!==0||K.remoteChange!==0)&&K.mergeState==="preview"&&await Y.merge(K.previewResource)}else await Y.sync(J,V)}catch(B){const K=n.UserDataSyncError.toUserDataSyncError(B);if(E(K,U,this.userDataSyncStoreManagementService,this.telemetryService),a(B))throw K;this.logService.error(B),this.logService.error(`${Y.resource}: ${(0,_.toErrorMessage)(B)}`),z.push([Y.resource,K])}}return z}finally{this.updateStatus()}}async apply(u,C){const U=(0,n.createSyncHeaders)(u);for(const F of this.enabled){if(C.isCancellationRequested)return;try{await F.apply(!1,U)}catch(M){const z=n.UserDataSyncError.toUserDataSyncError(M);if(E(z,u,this.userDataSyncStoreManagementService,this.telemetryService),a(M))throw z;this.logService.error(M),this.logService.error(`${F.resource}: ${(0,_.toErrorMessage)(M)}`)}}}async stop(){for(const u of this.enabled)try{u.status!=="idle"&&await u.stop()}catch(C){this.logService.error(C)}}async resetLocal(){for(const u of this.enabled)try{await u.resetLocal()}catch(C){this.logService.error(`${u.resource}: ${(0,_.toErrorMessage)(C)}`),this.logService.error(C)}}async getUserDataSyncConfiguration(u){if(!this.profile.isDefault)return{};const C=this.configurationService.getValue(n.USER_DATA_SYNC_CONFIGURATION_SCOPE),U=this.enabled.find(F=>F instanceof y.SettingsSynchroniser);if(U){const F=await U.getRemoteUserDataSyncConfiguration(u);return{...C,...F}}return C}setStatus(u){this._status!==u&&(this._status=u,this._onDidChangeStatus.fire(u))}updateStatus(){return this.updateConflicts(),this.enabled.some(u=>u.status==="hasConflicts")?this.setStatus("hasConflicts"):this.enabled.some(u=>u.status==="syncing")?this.setStatus("syncing"):this.setStatus("idle")}updateConflicts(){const u=this.enabled.filter(C=>C.status==="hasConflicts").filter(C=>C.conflicts.conflicts.length>0).map(C=>C.conflicts);(0,I.equals)(this._conflicts,u,(C,U)=>C.syncResource===U.syncResource&&(0,I.equals)(C.conflicts,U.conflicts,(F,M)=>(0,b.isEqual)(F.previewResource,M.previewResource)))||(this._conflicts=u,this._onDidChangeConflicts.fire(u))}getOrder(u){switch(u){case"settings":return 0;case"keybindings":return 1;case"snippets":return 2;case"tasks":return 3;case"globalState":return 4;case"extensions":return 5;case"profiles":return 6;case"workspaceState":return 7}}};r=Ee([G(2,n.IUserDataSyncEnablementService),G(3,h.IInstantiationService),G(4,g.IExtensionGalleryService),G(5,n.IUserDataSyncStoreManagementService),G(6,w.ITelemetryService),G(7,n.IUserDataSyncLogService),G(8,l.IUserDataProfilesService),G(9,p.IConfigurationService)],r);function a(v){if(v instanceof n.UserDataSyncError)switch(v.code){case"MethodNotFound":case"TooLarge":case"RemoteTooManyRequests":case"TooManyRequestsAndRetryAfter":case"LocalTooManyRequests":case"LocalTooManyProfiles":case"Gone":case"UpgradeRequired":case"IncompatibleRemoteContent":case"IncompatibleLocalContent":return!0}return!1}function E(v,u,C,U){U.publicLog2("sync/error",{code:v.code,serverCode:v instanceof n.UserDataSyncStoreError?String(v.serverCode):void 0,url:v instanceof n.UserDataSyncStoreError?v.url:void 0,resource:v.resource,executionId:u,service:C.userDataSyncStore.url.toString()})}}),define(ce[258],le([0,1,3,2,11,17,24]),function(te,e,I,O,A,_,k){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataSyncChannelClient=e.UserDataSyncChannel=void 0;function D(g,h){return{...g,profile:(0,_.reviveProfile)(g.profile,h.profilesHome.scheme)}}function b(g){return{created:g.created,uri:A.URI.revive(g.uri)}}class S{constructor(h,f,w){this.service=h,this.userDataProfilesService=f,this.logService=w,this.manualSyncTasks=new Map,this.onManualSynchronizeResources=new I.Emitter}listen(h,f){switch(f){case"onDidChangeStatus":return this.service.onDidChangeStatus;case"onDidChangeConflicts":return this.service.onDidChangeConflicts;case"onDidChangeLocal":return this.service.onDidChangeLocal;case"onDidChangeLastSyncTime":return this.service.onDidChangeLastSyncTime;case"onSyncErrors":return this.service.onSyncErrors;case"onDidResetLocal":return this.service.onDidResetLocal;case"onDidResetRemote":return this.service.onDidResetRemote;case"manualSync/onSynchronizeResources":return this.onManualSynchronizeResources.event}throw new Error(`Event not found: ${f}`)}async call(h,f,w){try{return await this._call(h,f,w)}catch(l){throw this.logService.error(l),l}}async _call(h,f,w){switch(f){case"_getInitialData":return Promise.resolve([this.service.status,this.service.conflicts,this.service.lastSyncTime]);case"reset":return this.service.reset();case"resetRemote":return this.service.resetRemote();case"resetLocal":return this.service.resetLocal();case"hasPreviouslySynced":return this.service.hasPreviouslySynced();case"hasLocalData":return this.service.hasLocalData();case"resolveContent":return this.service.resolveContent(A.URI.revive(w[0]));case"accept":return this.service.accept(D(w[0],this.userDataProfilesService),A.URI.revive(w[1]),w[2],w[3]);case"getRemoteProfiles":return this.service.getRemoteProfiles();case"getLocalSyncResourceHandles":return this.service.getLocalSyncResourceHandles(w[0],w[1]?(0,_.reviveProfile)(w[1],this.userDataProfilesService.profilesHome.scheme):void 0);case"getRemoteSyncResourceHandles":return this.service.getRemoteSyncResourceHandles(w[0],w[1]);case"replace":return this.service.replace(b(w[0]));case"getAssociatedResources":return this.service.getAssociatedResources(b(w[0]));case"getMachineId":return this.service.getMachineId(b(w[0]));case"cleanUpRemoteData":return this.service.cleanUpRemoteData();case"createManualSyncTask":return this.createManualSyncTask()}if(f.startsWith("manualSync/")){const l=f.substring(11),d=w[0],c=this.getManualSyncTask(d);switch(w=w.slice(1),l){case"merge":return c.merge();case"apply":return c.apply().then(()=>this.manualSyncTasks.delete(this.createKey(c.id)));case"stop":return c.stop().finally(()=>this.manualSyncTasks.delete(this.createKey(c.id)))}}throw new Error("Invalid call")}getManualSyncTask(h){const f=this.manualSyncTasks.get(this.createKey(h));if(!f)throw new Error(`Manual sync taks not found: ${h}`);return f}async createManualSyncTask(){const h=await this.service.createManualSyncTask();return this.manualSyncTasks.set(this.createKey(h.id),h),h.id}createKey(h){return`manualSyncTask-${h}`}}e.UserDataSyncChannel=S;let P=class extends O.Disposable{get status(){return this._status}get onDidChangeLocal(){return this.channel.listen("onDidChangeLocal")}get conflicts(){return this._conflicts}get lastSyncTime(){return this._lastSyncTime}get onDidResetLocal(){return this.channel.listen("onDidResetLocal")}get onDidResetRemote(){return this.channel.listen("onDidResetRemote")}constructor(h,f){super(),this.userDataProfilesService=f,this._status="uninitialized",this._onDidChangeStatus=this._register(new I.Emitter),this.onDidChangeStatus=this._onDidChangeStatus.event,this._conflicts=[],this._onDidChangeConflicts=this._register(new I.Emitter),this.onDidChangeConflicts=this._onDidChangeConflicts.event,this._lastSyncTime=void 0,this._onDidChangeLastSyncTime=this._register(new I.Emitter),this.onDidChangeLastSyncTime=this._onDidChangeLastSyncTime.event,this._onSyncErrors=this._register(new I.Emitter),this.onSyncErrors=this._onSyncErrors.event,this.channel={call(w,l,d){return h.call(w,l,d).then(null,c=>{throw k.UserDataSyncError.toUserDataSyncError(c)})},listen(w,l){return h.listen(w,l)}},this.channel.call("_getInitialData").then(([w,l,d])=>{this.updateStatus(w),this.updateConflicts(l),d&&this.updateLastSyncTime(d),this._register(this.channel.listen("onDidChangeStatus")(c=>this.updateStatus(c))),this._register(this.channel.listen("onDidChangeLastSyncTime")(c=>this.updateLastSyncTime(c)))}),this._register(this.channel.listen("onDidChangeConflicts")(w=>this.updateConflicts(w))),this._register(this.channel.listen("onSyncErrors")(w=>this._onSyncErrors.fire(w.map(l=>({...l,error:k.UserDataSyncError.toUserDataSyncError(l.error)})))))}createSyncTask(){throw new Error("not supported")}async createManualSyncTask(){const h=await this.channel.call("createManualSyncTask"),f=this;return new p(h,{async call(l,d,c){return f.channel.call(`manualSync/${l}`,[h,...Array.isArray(d)?d:[d]],c)},listen(){throw new Error("not supported")}})}reset(){return this.channel.call("reset")}resetRemote(){return this.channel.call("resetRemote")}resetLocal(){return this.channel.call("resetLocal")}hasPreviouslySynced(){return this.channel.call("hasPreviouslySynced")}hasLocalData(){return this.channel.call("hasLocalData")}accept(h,f,w,l){return this.channel.call("accept",[h,f,w,l])}resolveContent(h){return this.channel.call("resolveContent",[h])}getRemoteProfiles(){return this.channel.call("getRemoteProfiles")}async getLocalSyncResourceHandles(h,f){return(await this.channel.call("getLocalSyncResourceHandles",[h,f])).map(({created:l,uri:d})=>({created:l,uri:A.URI.revive(d)}))}async getRemoteSyncResourceHandles(h,f){return(await this.channel.call("getRemoteSyncResourceHandles",[h,f])).map(({created:l,uri:d})=>({created:l,uri:A.URI.revive(d)}))}async getAssociatedResources(h){return(await this.channel.call("getAssociatedResources",[h])).map(({resource:w,comparableResource:l})=>({resource:A.URI.revive(w),comparableResource:A.URI.revive(l)}))}getMachineId(h){return this.channel.call("getMachineId",[h])}cleanUpRemoteData(){return this.channel.call("cleanUpRemoteData")}replace(h){return this.channel.call("replace",[h])}async updateStatus(h){this._status=h,this._onDidChangeStatus.fire(h)}async updateConflicts(h){this._conflicts=h.map(f=>({syncResource:f.syncResource,profile:(0,_.reviveProfile)(f.profile,this.userDataProfilesService.profilesHome.scheme),conflicts:f.conflicts.map(w=>({...w,baseResource:A.URI.revive(w.baseResource),localResource:A.URI.revive(w.localResource),remoteResource:A.URI.revive(w.remoteResource),previewResource:A.URI.revive(w.previewResource)}))})),this._onDidChangeConflicts.fire(this._conflicts)}updateLastSyncTime(h){this._lastSyncTime!==h&&(this._lastSyncTime=h,this._onDidChangeLastSyncTime.fire(h))}};e.UserDataSyncChannelClient=P,e.UserDataSyncChannelClient=P=Ee([G(1,_.IUserDataProfilesService)],P);class p extends O.Disposable{constructor(h,f){super(),this.id=h,this.channel=f}async merge(){return this.channel.call("merge")}async apply(){return this.channel.call("apply")}stop(){return this.channel.call("stop")}dispose(){this.channel.call("dispose")}}}),define(ce[259],le([0,1,5,25,8,3,2,141,6,22,12,11,32,18,15,13,23,57,45,19,24]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RequestsSession=e.UserDataSyncStoreService=e.UserDataSyncStoreClient=e.UserDataSyncStoreManagementService=e.AbstractUserDataSyncStoreManagementService=void 0;const T="configurationSync.store",t="sync.previous.store",o="sync.donot-make-requests-until",n="sync.user-session-id",s="sync.machine-session-id",i=100,r=1e3*60*5;let a=class extends k.Disposable{get userDataSyncStore(){return this._userDataSyncStore}get userDataSyncStoreType(){return this.storageService.get(y.SYNC_SERVICE_URL_TYPE,-1)}set userDataSyncStoreType(F){this.storageService.store(y.SYNC_SERVICE_URL_TYPE,F,-1,b.isWeb?0:1)}constructor(F,M,z){super(),this.productService=F,this.configurationService=M,this.storageService=z,this._onDidChangeUserDataSyncStore=this._register(new _.Emitter),this.onDidChangeUserDataSyncStore=this._onDidChangeUserDataSyncStore.event,this.updateUserDataSyncStore();const V=this._register(new k.DisposableStore);this._register(_.Event.filter(z.onDidChangeValue(-1,y.SYNC_SERVICE_URL_TYPE,V),()=>this.userDataSyncStoreType!==this.userDataSyncStore?.type,V)(()=>this.updateUserDataSyncStore()))}updateUserDataSyncStore(){this._userDataSyncStore=this.toUserDataSyncStore(this.productService[T]),this._onDidChangeUserDataSyncStore.fire()}toUserDataSyncStore(F){if(F&&(F=b.isWeb&&F.web?{...F,...F.web}:F,(0,P.isString)(F.url)&&(0,P.isObject)(F.authenticationProviders)&&Object.keys(F.authenticationProviders).every(M=>Array.isArray(F.authenticationProviders[M].scopes)))){const M=F,z=!!M.canSwitch,V=M.url===M.insidersUrl?"insiders":"stable",J=(z?this.userDataSyncStoreType:void 0)||V,H=J==="insiders"?M.insidersUrl:J==="stable"?M.stableUrl:M.url;return{url:p.URI.parse(H),type:J,defaultType:V,defaultUrl:p.URI.parse(M.url),stableUrl:p.URI.parse(M.stableUrl),insidersUrl:p.URI.parse(M.insidersUrl),canSwitch:z,authenticationProviders:Object.keys(M.authenticationProviders).reduce((Y,B)=>(Y.push({id:B,scopes:M.authenticationProviders[B].scopes}),Y),[])}}}};e.AbstractUserDataSyncStoreManagementService=a,e.AbstractUserDataSyncStoreManagementService=a=Ee([G(0,l.IProductService),G(1,h.IConfigurationService),G(2,m.IStorageService)],a);let E=class extends a{constructor(F,M,z){super(F,M,z);const V=this.storageService.get(t,-1);V&&(this.previousConfigurationSyncStore=JSON.parse(V));const J=this.productService[T];J?this.storageService.store(t,JSON.stringify(J),-1,1):this.storageService.remove(t,-1)}async switch(F){F!==this.userDataSyncStoreType&&(this.userDataSyncStoreType=F,this.updateUserDataSyncStore())}async getPreviousUserDataSyncStore(){return this.toUserDataSyncStore(this.previousConfigurationSyncStore)}};e.UserDataSyncStoreManagementService=E,e.UserDataSyncStoreManagementService=E=Ee([G(0,l.IProductService),G(1,h.IConfigurationService),G(2,m.IStorageService)],E);let v=class extends k.Disposable{get donotMakeRequestsUntil(){return this._donotMakeRequestsUntil}constructor(F,M,z,V,J,H,Y){super(),this.requestService=z,this.logService=V,this.storageService=Y,this._onTokenFailed=this._register(new _.Emitter),this.onTokenFailed=this._onTokenFailed.event,this._onTokenSucceed=this._register(new _.Emitter),this.onTokenSucceed=this._onTokenSucceed.event,this._donotMakeRequestsUntil=void 0,this._onDidChangeDonotMakeRequestsUntil=this._register(new _.Emitter),this.onDidChangeDonotMakeRequestsUntil=this._onDidChangeDonotMakeRequestsUntil.event,this.resetDonotMakeRequestsUntilPromise=void 0,this.updateUserDataSyncStoreUrl(F),this.commonHeadersPromise=(0,c.getServiceMachineId)(J,H,Y).then(B=>{const K={"X-Client-Name":`${M.applicationName}${b.isWeb?"-web":""}`,"X-Client-Version":M.version};return M.commit&&(K["X-Client-Commit"]=M.commit),K}),this.session=new C(i,r,this.requestService,this.logService),this.initDonotMakeRequestsUntil(),this._register((0,k.toDisposable)(()=>{this.resetDonotMakeRequestsUntilPromise&&(this.resetDonotMakeRequestsUntilPromise.cancel(),this.resetDonotMakeRequestsUntilPromise=void 0)}))}setAuthToken(F,M){this.authToken={token:F,type:M}}updateUserDataSyncStoreUrl(F){this.userDataSyncStoreUrl=F?(0,S.joinPath)(F,"v1"):void 0}initDonotMakeRequestsUntil(){const F=this.storageService.getNumber(o,-1);F&&Date.now()<F&&this.setDonotMakeRequestsUntil(new Date(F))}setDonotMakeRequestsUntil(F){this._donotMakeRequestsUntil?.getTime()!==F?.getTime()&&(this._donotMakeRequestsUntil=F,this.resetDonotMakeRequestsUntilPromise&&(this.resetDonotMakeRequestsUntilPromise.cancel(),this.resetDonotMakeRequestsUntilPromise=void 0),this._donotMakeRequestsUntil?(this.storageService.store(o,this._donotMakeRequestsUntil.getTime(),-1,1),this.resetDonotMakeRequestsUntilPromise=(0,I.createCancelablePromise)(M=>(0,I.timeout)(this._donotMakeRequestsUntil.getTime()-Date.now(),M).then(()=>this.setDonotMakeRequestsUntil(void 0))),this.resetDonotMakeRequestsUntilPromise.then(null,M=>null)):this.storageService.remove(o,-1),this._onDidChangeDonotMakeRequestsUntil.fire())}async getAllCollections(F={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const M=(0,S.joinPath)(this.userDataSyncStoreUrl,"collection").toString();F={...F},F["Content-Type"]="application/json";const z=await this.request(M,{type:"GET",headers:F},[],O.CancellationToken.None);return(await(0,d.asJson)(z))?.map(({id:V})=>V)||[]}async createCollection(F={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const M=(0,S.joinPath)(this.userDataSyncStoreUrl,"collection").toString();F={...F},F["Content-Type"]=D.Mimes.text;const z=await this.request(M,{type:"POST",headers:F},[],O.CancellationToken.None),V=await(0,d.asTextOrError)(z);if(!V)throw new y.UserDataSyncStoreError("Server did not return the collection id",M,"NoCollection",z.res.statusCode,z.res.headers[y.HEADER_OPERATION_ID]);return V}async deleteCollection(F,M={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const z=F?(0,S.joinPath)(this.userDataSyncStoreUrl,"collection",F).toString():(0,S.joinPath)(this.userDataSyncStoreUrl,"collection").toString();M={...M},await this.request(z,{type:"DELETE",headers:M},[],O.CancellationToken.None)}async getAllResourceRefs(F,M){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const z=this.getResourceUrl(this.userDataSyncStoreUrl,M,F),V={},J=await this.request(z.toString(),{type:"GET",headers:V},[],O.CancellationToken.None);return(await(0,d.asJson)(J)||[]).map(({url:Y,created:B})=>({ref:(0,S.relativePath)(z,z.with({path:Y})),created:B*1e3}))}async resolveResourceContent(F,M,z,V={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const J=(0,S.joinPath)(this.getResourceUrl(this.userDataSyncStoreUrl,z,F),M).toString();V={...V},V["Cache-Control"]="no-cache";const H=await this.request(J,{type:"GET",headers:V},[],O.CancellationToken.None);return await(0,d.asTextOrError)(H)}async deleteResource(F,M,z){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const V=M!==null?(0,S.joinPath)(this.getResourceUrl(this.userDataSyncStoreUrl,z,F),M).toString():this.getResourceUrl(this.userDataSyncStoreUrl,z,F).toString(),J={};await this.request(V,{type:"DELETE",headers:J},[],O.CancellationToken.None)}async deleteResources(){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const F=(0,S.joinPath)(this.userDataSyncStoreUrl,"resource").toString(),M={"Content-Type":D.Mimes.text};await this.request(F,{type:"DELETE",headers:M},[],O.CancellationToken.None)}async readResource(F,M,z,V={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const J=(0,S.joinPath)(this.getResourceUrl(this.userDataSyncStoreUrl,z,F),"latest").toString();V={...V},V["Cache-Control"]="no-cache",M&&(V["If-None-Match"]=M.ref);const H=await this.request(J,{type:"GET",headers:V},[304],O.CancellationToken.None);let Y=null;if(H.res.statusCode===304&&(Y=M),Y===null){const B=H.res.headers.etag;if(!B)throw new y.UserDataSyncStoreError("Server did not return the ref",J,"NoRef",H.res.statusCode,H.res.headers[y.HEADER_OPERATION_ID]);const K=await(0,d.asTextOrError)(H);if(!K&&H.res.statusCode===304)throw new y.UserDataSyncStoreError("Empty response",J,"EmptyResponse",H.res.statusCode,H.res.headers[y.HEADER_OPERATION_ID]);Y={ref:B,content:K}}return Y}async writeResource(F,M,z,V,J={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const H=this.getResourceUrl(this.userDataSyncStoreUrl,V,F).toString();J={...J},J["Content-Type"]=D.Mimes.text,z&&(J["If-Match"]=z);const Y=await this.request(H,{type:"POST",data:M,headers:J},[],O.CancellationToken.None),B=Y.res.headers.etag;if(!B)throw new y.UserDataSyncStoreError("Server did not return the ref",H,"NoRef",Y.res.statusCode,Y.res.headers[y.HEADER_OPERATION_ID]);return B}async manifest(F,M={}){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");const z=(0,S.joinPath)(this.userDataSyncStoreUrl,"manifest").toString();M={...M},M["Content-Type"]="application/json",F&&(M["If-None-Match"]=F.ref);const V=await this.request(z,{type:"GET",headers:M},[304],O.CancellationToken.None);let J=null;if(V.res.statusCode===304&&(J=F),!J){const Y=V.res.headers.etag;if(!Y)throw new y.UserDataSyncStoreError("Server did not return the ref",z,"NoRef",V.res.statusCode,V.res.headers[y.HEADER_OPERATION_ID]);const B=await(0,d.asTextOrError)(V);if(!B&&V.res.statusCode===304)throw new y.UserDataSyncStoreError("Empty response",z,"EmptyResponse",V.res.statusCode,V.res.headers[y.HEADER_OPERATION_ID]);B&&(J={...JSON.parse(B),ref:Y})}const H=this.storageService.get(n,-1);return H&&J&&H!==J.session&&this.clearSession(),J===null&&H&&this.clearSession(),J&&this.storageService.store(n,J.session,-1,1),J}async clear(){if(!this.userDataSyncStoreUrl)throw new Error("No settings sync store url configured.");await this.deleteCollection(),await this.deleteResources(),this.clearSession()}getResourceUrl(F,M,z){return M?(0,S.joinPath)(F,"collection",M,"resource",z):(0,S.joinPath)(F,"resource",z)}clearSession(){this.storageService.remove(n,-1),this.storageService.remove(s,-1)}async request(F,M,z,V){if(!this.authToken)throw new y.UserDataSyncStoreError("No Auth Token Available",F,"Unauthorized",void 0,void 0);if(this._donotMakeRequestsUntil&&Date.now()<this._donotMakeRequestsUntil.getTime())throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of too many requests (429).`,F,"TooManyRequestsAndRetryAfter",void 0,void 0);this.setDonotMakeRequestsUntil(void 0);const J=await this.commonHeadersPromise;M.headers={...M.headers||{},...J,"X-Account-Type":this.authToken.type,authorization:`Bearer ${this.authToken.token}`},this.addSessionHeaders(M.headers),this.logService.trace("Sending request to server",{url:F,type:M.type,headers:{...M.headers,authorization:void 0}});let H;try{H=await this.session.request(F,M,V)}catch(q){if(!(q instanceof y.UserDataSyncStoreError)){let j="RequestFailed";const Z=(0,A.getErrorMessage)(q).toLowerCase();Z.includes("xhr timeout")?j="RequestTimeout":Z.includes("protocol")&&Z.includes("not supported")?j="RequestProtocolNotSupported":Z.includes("request path contains unescaped characters")?j="RequestPathNotEscaped":Z.includes("headers must be an object")?j="RequestHeadersNotObject":(0,A.isCancellationError)(q)&&(j="RequestCanceled"),q=new y.UserDataSyncStoreError(`Connection refused for the request '${F}'.`,F,j,void 0,void 0)}throw this.logService.info("Request failed",F),q}const Y=H.res.headers[y.HEADER_OPERATION_ID],B={url:F,status:H.res.statusCode,"execution-id":M.headers[y.HEADER_EXECUTION_ID],"operation-id":Y},K=(0,d.isSuccess)(H)||H.res.statusCode&&z.includes(H.res.statusCode);let x="";if(K?this.logService.trace("Request succeeded",B):(x=await(0,d.asText)(H)||"",this.logService.info("Request failed",B,x)),H.res.statusCode===401||H.res.statusCode===403){if(this.authToken=void 0,H.res.statusCode===401)throw this._onTokenFailed.fire("Unauthorized"),new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of Unauthorized (401).`,F,"Unauthorized",H.res.statusCode,Y);if(H.res.statusCode===403)throw this._onTokenFailed.fire("Forbidden"),new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because the access is forbidden (403).`,F,"Forbidden",H.res.statusCode,Y)}if(this._onTokenSucceed.fire(),H.res.statusCode===404)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because the requested resource is not found (404).`,F,"NotFound",H.res.statusCode,Y);if(H.res.statusCode===405)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because the requested endpoint is not found (405). ${x}`,F,"MethodNotFound",H.res.statusCode,Y);if(H.res.statusCode===409)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of Conflict (409). There is new data for this resource. Make the request again with latest data.`,F,"Conflict",H.res.statusCode,Y);if(H.res.statusCode===410)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because the requested resource is not longer available (410).`,F,"Gone",H.res.statusCode,Y);if(H.res.statusCode===412)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of Precondition Failed (412). There is new data for this resource. Make the request again with latest data.`,F,"PreconditionFailed",H.res.statusCode,Y);if(H.res.statusCode===413)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of too large payload (413).`,F,"TooLarge",H.res.statusCode,Y);if(H.res.statusCode===426)throw new y.UserDataSyncStoreError(`${M.type} request '${F}' failed with status Upgrade Required (426). Please upgrade the client and try again.`,F,"UpgradeRequired",H.res.statusCode,Y);if(H.res.statusCode===429){const q=H.res.headers["retry-after"];throw q?(this.setDonotMakeRequestsUntil(new Date(Date.now()+parseInt(q)*1e3)),new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of too many requests (429).`,F,"TooManyRequestsAndRetryAfter",H.res.statusCode,Y)):new y.UserDataSyncStoreError(`${M.type} request '${F}' failed because of too many requests (429).`,F,"RemoteTooManyRequests",H.res.statusCode,Y)}if(!K)throw new y.UserDataSyncStoreError("Server returned "+H.res.statusCode,F,"Unknown",H.res.statusCode,Y);return H}addSessionHeaders(F){let M=this.storageService.get(s,-1);M===void 0&&(M=(0,g.generateUuid)(),this.storageService.store(s,M,-1,1)),F["X-Machine-Session-Id"]=M;const z=this.storageService.get(n,-1);z!==void 0&&(F["X-User-Session-Id"]=z)}};e.UserDataSyncStoreClient=v,e.UserDataSyncStoreClient=v=Ee([G(1,l.IProductService),G(2,d.IRequestService),G(3,y.IUserDataSyncLogService),G(4,f.IEnvironmentService),G(5,w.IFileService),G(6,m.IStorageService)],v);let u=class extends v{constructor(F,M,z,V,J,H,Y){super(F.userDataSyncStore?.url,M,z,V,J,H,Y),this._register(F.onDidChangeUserDataSyncStore(()=>this.updateUserDataSyncStoreUrl(F.userDataSyncStore?.url)))}};e.UserDataSyncStoreService=u,e.UserDataSyncStoreService=u=Ee([G(0,y.IUserDataSyncStoreManagementService),G(1,l.IProductService),G(2,d.IRequestService),G(3,y.IUserDataSyncLogService),G(4,f.IEnvironmentService),G(5,w.IFileService),G(6,m.IStorageService)],u);class C{constructor(F,M,z,V){this.limit=F,this.interval=M,this.requestService=z,this.logService=V,this.requests=[],this.startTime=void 0}request(F,M,z){if(this.isExpired()&&this.reset(),M.url=F,this.requests.length>=this.limit)throw this.logService.info("Too many requests",...this.requests),new y.UserDataSyncStoreError(`Too many requests. Only ${this.limit} requests allowed in ${this.interval/(1e3*60)} minutes.`,F,"LocalTooManyRequests",void 0,void 0);return this.startTime=this.startTime||new Date,this.requests.push(F),this.requestService.request(M,z)}isExpired(){return this.startTime!==void 0&&new Date().getTime()-this.startTime.getTime()>this.interval}reset(){this.requests=[],this.startTime=void 0}}e.RequestsSession=C}),define(ce[260],le([0,1,3,55,23,19,21,255,24,78,81]),function(te,e,I,O,A,_,k,D,b,S,P){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserDataAutoSyncService=void 0;let p=class extends D.UserDataAutoSyncService{constructor(h,f,w,l,d,c,m,y,T,t,o){super(h,f,w,l,d,m,y,T,t,o),this._register(I.Event.debounce(I.Event.any(I.Event.map(c.onDidFocusWindow,()=>"windowFocus"),I.Event.map(c.onDidOpenWindow,()=>"windowOpen")),(n,s)=>n?[...n,s]:[s],1e3)(n=>this.triggerSync(n,!0,!1)))}};e.UserDataAutoSyncService=p,e.UserDataAutoSyncService=p=Ee([G(0,A.IProductService),G(1,b.IUserDataSyncStoreManagementService),G(2,b.IUserDataSyncStoreService),G(3,b.IUserDataSyncEnablementService),G(4,b.IUserDataSyncService),G(5,O.INativeHostService),G(6,b.IUserDataSyncLogService),G(7,S.IUserDataSyncAccountService),G(8,k.ITelemetryService),G(9,P.IUserDataSyncMachinesService),G(10,_.IStorageService)],p)}),define(ce[261],le([0,1,68,26,6,22]),function(te,e,I,O,A,_){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createEmptyWorkspaceIdentifier=e.getSingleFolderWorkspaceIdentifier=e.getWorkspaceIdentifier=e.NON_EMPTY_WORKSPACE_ID_LENGTH=void 0,e.NON_EMPTY_WORKSPACE_ID_LENGTH=128/4;function k(S){function P(){let p=S.scheme===O.Schemas.file?(0,_.originalFSPath)(S):S.toString();return A.isLinux||(p=p.toLowerCase()),(0,I.createHash)("md5").update(p).digest("hex")}return{id:P(),configPath:S}}e.getWorkspaceIdentifier=k;function D(S,P){function p(){if(S.scheme!==O.Schemas.file)return(0,I.createHash)("md5").update(S.toString()).digest("hex");if(!P)return;let h;return A.isLinux?h=P.ino:A.isMacintosh?h=P.birthtime.getTime():A.isWindows&&(typeof P.birthtimeMs=="number"?h=Math.floor(P.birthtimeMs):h=P.birthtime.getTime()),(0,I.createHash)("md5").update(S.fsPath).update(h?String(h):"").digest("hex")}const g=p();if(typeof g=="string")return{id:g,uri:S}}e.getSingleFolderWorkspaceIdentifier=D;function b(){return{id:(Date.now()+Math.round(Math.random()*1e3)).toString()}}e.createEmptyWorkspaceIdentifier=b}),define(ce[262],le([0,1,5,8,2,16,31,15,7,75,114,261,55,70]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UnusedWorkspaceStorageDataCleaner=void 0;let f=class extends A.Disposable{constructor(l,d,c,m){super(),this.environmentService=l,this.logService=d,this.nativeHostService=c,this.mainProcessService=m,this._register(new I.RunOnceScheduler(()=>{this.cleanUpStorage()},30*1e3)).schedule()}async cleanUpStorage(){this.logService.trace("[storage cleanup]: Starting to clean up workspace storage folders for unused empty workspaces.");try{const l=await k.Promises.readdir(this.environmentService.workspaceStorageHome.fsPath),d=new S.StorageClient(this.mainProcessService.getChannel("storage"));await Promise.all(l.map(async c=>{const m=(0,_.join)(this.environmentService.workspaceStorageHome.fsPath,c);c.length===p.NON_EMPTY_WORKSPACE_ID_LENGTH||c===P.EXTENSION_DEVELOPMENT_EMPTY_WINDOW_WORKSPACE.id||(await this.nativeHostService.getWindows()).some(t=>t.workspace?.id===c)||await d.isUsed(m)||(this.logService.trace(`[storage cleanup]: Deleting workspace storage folder ${c} as it seems to be an unused empty workspace.`),await k.Promises.rm(m))}))}catch(l){(0,O.onUnexpectedError)(l)}}};e.UnusedWorkspaceStorageDataCleaner=f,e.UnusedWorkspaceStorageDataCleaner=f=Ee([G(0,D.INativeEnvironmentService),G(1,b.ILogService),G(2,g.INativeHostService),G(3,h.IMainProcessService)],f)}),define(ce[82],le([0,1,52,5,16,12,31,148,273,274]),function(te,e,I,O,A,_,k,D,b,S){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buffer=e.extract=e.zip=e.ExtractError=e.CorruptZipMessage=void 0,e.CorruptZipMessage="end of central directory record signature not found";const P=new RegExp(e.CorruptZipMessage);class p extends Error{constructor(o,n){let s=n.message;switch(o){case"CorruptZip":s=`Corrupt ZIP: ${s}`;break}super(s),this.type=o,this.cause=n}}e.ExtractError=p;function g(t){const o=t.externalFileAttributes>>16||33188;return[448,56,7].map(n=>o&n).reduce((n,s)=>n+s,o&61440)}function h(t){if(t instanceof p)return t;let o;return P.test(t.message)&&(o="CorruptZip"),new p(o,t)}function f(t,o,n,s,i,r){const a=A.dirname(o),E=A.join(s,a);if(!E.startsWith(s))return Promise.reject(new Error(D.localize(0,null,o)));const v=A.join(s,o);let u;return r.onCancellationRequested(()=>{u?.destroy()}),Promise.resolve(k.Promises.mkdir(E,{recursive:!0})).then(()=>new Promise((C,U)=>{if(!r.isCancellationRequested)try{u=(0,I.createWriteStream)(v,{mode:n}),u.once("close",()=>C()),u.once("error",U),t.once("error",U),t.pipe(u)}catch(F){U(F)}}))}function w(t,o,n,s){let i=(0,O.createCancelablePromise)(()=>Promise.resolve()),r=0;return s.onCancellationRequested(()=>{i.cancel(),t.close()}),new Promise((a,E)=>{const v=new O.Sequencer,u=C=>{C.isCancellationRequested||(r++,t.readEntry())};t.once("error",E),t.once("close",()=>i.then(()=>{s.isCancellationRequested||t.entryCount===r?a():E(new p("Incomplete",new Error(D.localize(1,null,r,t.entryCount))))},E)),t.readEntry(),t.on("entry",C=>{if(s.isCancellationRequested)return;if(!n.sourcePathRegex.test(C.fileName)){u(s);return}const U=C.fileName.replace(n.sourcePathRegex,"");if(/\/$/.test(U)){const z=A.join(o,U);i=(0,O.createCancelablePromise)(V=>k.Promises.mkdir(z,{recursive:!0}).then(()=>u(V)).then(void 0,E));return}const F=d(t,C),M=g(C);i=(0,O.createCancelablePromise)(z=>v.queue(()=>F.then(V=>f(V,U,M,o,n,z).then(()=>u(z)))).then(null,E))})})}function l(t,o=!1){return new Promise((n,s)=>{(0,b.open)(t,o?{lazyEntries:!0}:void 0,(i,r)=>{i?s(h(i)):n((0,_.assertIsDefined)(r))})})}function d(t,o){return new Promise((n,s)=>{t.openReadStream(o,(i,r)=>{i?s(h(i)):n((0,_.assertIsDefined)(r))})})}function c(t,o){return new Promise((n,s)=>{const i=new S.ZipFile;o.forEach(a=>{a.contents?i.addBuffer(typeof a.contents=="string"?Buffer.from(a.contents,"utf8"):a.contents,a.path):a.localPath&&i.addFile(a.localPath,a.path)}),i.end();const r=(0,I.createWriteStream)(t);i.outputStream.pipe(r),i.outputStream.once("error",s),r.once("error",s),r.once("finish",()=>n(t))})}e.zip=c;function m(t,o,n={},s){const i=new RegExp(n.sourcePath?`^${n.sourcePath}`:"");let r=l(t,!0);return n.overwrite&&(r=r.then(a=>k.Promises.rm(o).then(()=>a))),r.then(a=>w(a,o,{sourcePathRegex:i},s))}e.extract=m;function y(t,o){return l(t).then(n=>new Promise((s,i)=>{n.on("entry",r=>{r.fileName===o&&d(n,r).then(a=>s(a),a=>i(a))}),n.once("close",()=>i(new Error(D.localize(2,null,o))))}))}function T(t,o){return y(t,o).then(n=>new Promise((s,i)=>{const r=[];n.once("error",i),n.on("data",a=>r.push(a)),n.on("end",()=>s(Buffer.concat(r)))}))}e.buffer=T}),define(ce[263],le([0,1,5,8,2,26,22,53,12,32,31,82,18,15,29,33,99,13,7]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c){"use strict";var m;Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsDownloader=void 0;let y=class extends A.Disposable{static{m=this}static{this.SignatureArchiveExtension=".sigzip"}constructor(t,o,n,s,i,r){super(),this.fileService=o,this.extensionGalleryService=n,this.configurationService=s,this.extensionSignatureVerificationService=i,this.logService=r,this.extensionsDownloadDir=t.extensionsDownloadLocation,this.cache=20,this.cleanUpPromise=this.cleanUp()}async download(t,o,n){await this.cleanUpPromise;const s=(0,k.joinPath)(this.extensionsDownloadDir,this.getName(t));try{await this.downloadFile(t,s,r=>this.extensionGalleryService.download(t,r,o))}catch(r){throw new f.ExtensionManagementError(r.message,f.ExtensionManagementErrorCode.Download)}let i=!1;if(n&&this.shouldVerifySignature(t)){const r=await this.downloadSignatureArchive(t);try{i=await this.extensionSignatureVerificationService.verify(s.fsPath,r.fsPath,this.logService.getLevel()===c.LogLevel.Trace)}catch(a){const E=a;if(i=E.code,E.output&&this.logService.trace(`Extension signature verification details for ${t.identifier.id} ${t.version}:
${E.output}`),i===f.ExtensionSignaturetErrorCode.PackageIsInvalidZip||i===f.ExtensionSignaturetErrorCode.SignatureArchiveIsInvalidZip)throw new f.ExtensionManagementError(p.CorruptZipMessage,f.ExtensionManagementErrorCode.CorruptZip)}finally{try{await this.delete(r)}catch(a){this.logService.error(a)}}}return i===!0?this.logService.info(`Extension signature is verified: ${t.identifier.id}`):i===!1?this.logService.info(`Extension signature verification is not done: ${t.identifier.id}`):this.logService.warn(`Extension signature verification failed with error '${i}': ${t.identifier.id}`),{location:s,verificationStatus:i}}shouldVerifySignature(t){if(!t.isSigned)return!1;const o=this.configurationService.getValue("extensions.verifySignature");return(0,b.isBoolean)(o)?o:!0}async downloadSignatureArchive(t){await this.cleanUpPromise;const o=(0,k.joinPath)(this.extensionsDownloadDir,`${this.getName(t)}${m.SignatureArchiveExtension}`);return await this.downloadFile(t,o,n=>this.extensionGalleryService.downloadSignatureArchive(t,n)),o}async downloadFile(t,o,n){if(await this.fileService.exists(o))return;if(o.scheme!==_.Schemas.file){await n(o);return}const s=(0,k.joinPath)(this.extensionsDownloadDir,`.${(0,S.generateUuid)()}`);await this.fileService.exists(s)||await n(s);try{await P.Promises.rename(s.fsPath,o.fsPath,2*60*1e3)}catch(i){try{await this.fileService.del(s)}catch{}if(i.code==="ENOTEMPTY")this.logService.info("Rename failed because the file was downloaded by another source. So ignoring renaming.",t.identifier.id,o.path);else throw this.logService.info(`Rename failed because of ${(0,O.getErrorMessage)(i)}. Deleted the file from downloaded location`,s.path),i}}async delete(t){await this.cleanUpPromise,await this.fileService.del(t)}async cleanUp(){try{if(!await this.fileService.exists(this.extensionsDownloadDir)){this.logService.trace("Extension VSIX downloads cache dir does not exist");return}const t=await this.fileService.resolve(this.extensionsDownloadDir,{resolveMetadata:!0});if(t.children){const o=[],n=[],s=[];for(const a of t.children)if(a.name.endsWith(m.SignatureArchiveExtension))s.push(a.resource);else{const E=w.ExtensionKey.parse(a.name);E&&n.push([E,a])}const i=(0,w.groupByExtension)(n,([a])=>a),r=[];for(const a of i)a.sort((E,v)=>D.rcompare(E[0].version,v[0].version)),o.push(...a.slice(1).map(E=>E[1].resource)),r.push(a[0][1]);r.sort((a,E)=>a.mtime-E.mtime),o.push(...r.slice(0,Math.max(0,r.length-this.cache)).map(a=>a.resource)),o.push(...s),await I.Promises.settled(o.map(a=>(this.logService.trace("Deleting from cache",a.path),this.fileService.del(a))))}}catch(t){this.logService.error(t)}}getName(t){return this.cache?w.ExtensionKey.create(t).toString().toLowerCase():(0,S.generateUuid)()}};e.ExtensionsDownloader=y,e.ExtensionsDownloader=y=m=Ee([G(0,h.INativeEnvironmentService),G(1,d.IFileService),G(2,f.IExtensionGalleryService),G(3,g.IConfigurationService),G(4,l.IExtensionSignatureVerificationService),G(5,c.ILogService)],y)}),define(ce[264],le([0,1,82,157]),function(te,e,I,O){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getManifest=void 0;function A(_){return(0,I.buffer)(_,"extension/package.json").then(k=>{try{return JSON.parse(k.toString("utf8"))}catch{throw new Error((0,O.localize)(0,null))}})}e.getManifest=A}),define(ce[123],le([0,1,91,5,14,25,38,8,3,51,2,35,26,16,22,53,12,11,32,31,82,156,98,15,243,29,33,50,79,263,244,264,212,223,66,13,4,7,23,21,27,17]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o,n,s,i,r,a,E,v,u,C,U,F,M,z,V,J,H,Y,B){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InstallGalleryExtensionTask=e.ExtensionsScanner=e.ExtensionManagementService=e.INativeServerExtensionManagementService=void 0,e.INativeServerExtensionManagementService=(0,z.refineServiceDecorator)(s.IExtensionManagementService);const K=".vsctmp";let x=class extends n.AbstractExtensionManagementService{constructor($,R,L,N,W,X,ne,re,Q,ee,ie,de){super($,R,ie,L,ee,de),this.extensionsScannerService=W,this.extensionsProfileScannerService=X,this.downloadService=ne,this.fileService=Q,this.installGalleryExtensionsTasks=new Map,this.knownDirectories=new p.ResourceSet;const fe=this._register(re.createInstance(v.ExtensionsLifecycle));this.extensionsScanner=this._register(re.createInstance(q,ye=>fe.postUninstall(ye))),this.manifestCache=this._register(new C.ExtensionsManifestCache(de,Q,ie,this,this.logService)),this.extensionsDownloader=this._register(re.createInstance(E.ExtensionsDownloader));const pe=this._register(new U.ExtensionsWatcher(this,this.extensionsScannerService,de,X,ie,Q,L));this._register(pe.onDidChangeExtensionsByAnotherSource(ye=>this.onDidChangeExtensionsFromAnotherSource(ye))),this.watchForExtensionsNotInstalledBySystem()}getTargetPlatform(){return this._targetPlatformPromise||(this._targetPlatformPromise=(0,i.computeTargetPlatform)(this.fileService,this.logService)),this._targetPlatformPromise}async zip($){this.logService.trace("ExtensionManagementService#zip",$.identifier.id);const R=await this.collectFiles($),L=await(0,y.zip)((0,f.joinPath)(this.extensionsDownloader.extensionsDownloadDir,(0,c.generateUuid)()).fsPath,R);return d.URI.file(L)}async unzip($){return this.logService.trace("ExtensionManagementService#unzip",$.toString()),(await this.install($)).identifier}async getManifest($){const{location:R,cleanup:L}=await this.downloadVsix($),N=h.resolve(R.fsPath);try{return await(0,u.getManifest)(N)}finally{await L()}}getInstalled($,R=this.userDataProfilesService.defaultProfile.extensionsResource){return this.extensionsScanner.scanExtensions($??null,R)}scanAllUserInstalledExtensions(){return this.extensionsScanner.scanAllUserExtensions(!1)}scanInstalledExtensionAtLocation($){return this.extensionsScanner.scanUserExtensionAtLocation($)}async install($,R={}){this.logService.trace("ExtensionManagementService#install",$.toString());const{location:L,cleanup:N}=await this.downloadVsix($);try{const W=await(0,u.getManifest)(h.resolve(L.fsPath)),X=(0,i.getGalleryExtensionId)(W.publisher,W.name);if(W.engines?.vscode&&!(0,F.isEngineValid)(W.engines.vscode,this.productService.vscodeVersion,this.productService.date))throw new Error(T.localize(0,null,X,this.productService.vscodeVersion));if(W.engines?.azdata&&!(0,F.isEngineValid)(W.engines.azdata,this.productService.version,this.productService.date))throw new s.ExtensionManagementError((0,I.extensionsWorkbenchServiceIncompatible)(X,W.version,this.productService.version,W.engines.azdata),s.ExtensionManagementErrorCode.Incompatible);const re=(await this.installExtensions([{manifest:W,extension:L,options:R}])).find(({identifier:Q})=>(0,i.areSameExtensions)(Q,{id:X}));if(re?.local)return re.local;throw re?.error?re.error:(0,n.toExtensionManagementError)(new Error(`Unknown error while installing extension ${X}`))}finally{await N()}}async installFromLocation($,R){this.logService.trace("ExtensionManagementService#installFromLocation",$.toString());const L=await this.extensionsScanner.scanUserExtensionAtLocation($);if(!L)throw new Error(`Cannot find a valid extension from the location ${$.toString()}`);return await this.addExtensionsToProfile([[L,void 0]],R),this.logService.info("Successfully installed extension",L.identifier.id,R.toString()),L}async installExtensionsFromProfile($,R,L){this.logService.trace("ExtensionManagementService#installExtensionsFromProfile",$,R.toString(),L.toString());const N=(await this.extensionsScanner.scanExtensions(1,R)).filter(W=>$.some(X=>(0,i.areSameExtensions)(X,W.identifier)));if(N.length){const W=await Promise.all(N.map(X=>this.extensionsScanner.scanMetadata(X,R)));await this.addExtensionsToProfile(N.map((X,ne)=>[X,W[ne]]),L),this.logService.info("Successfully installed extensions",N.map(X=>X.identifier.id),L.toString())}return N}async updateMetadata($,R,L=this.userDataProfilesService.defaultProfile.extensionsResource){return this.logService.trace("ExtensionManagementService#updateMetadata",$.identifier.id),R.isPreReleaseVersion&&(R.preRelease=!0),R.isMachineScoped=R.isMachineScoped||void 0,R.isBuiltin=R.isBuiltin||void 0,R.pinned=R.pinned||void 0,$=await this.extensionsScanner.updateMetadata($,R,L),this.manifestCache.invalidate(L),this._onDidUpdateExtensionMetadata.fire($),$}async reinstallFromGallery($){if(this.logService.trace("ExtensionManagementService#reinstallFromGallery",$.identifier.id),!this.galleryService.isEnabled())throw new Error(T.localize(1,null));const R=await this.getTargetPlatform(),[L]=await this.galleryService.getExtensions([{...$.identifier,preRelease:$.preRelease}],{targetPlatform:R,compatible:!0},_.CancellationToken.None);if(!L)throw new Error(T.localize(2,null));await this.extensionsScanner.setUninstalled($);try{await this.extensionsScanner.removeUninstalledExtension($)}catch(N){throw new Error(T.localize(3,null,(0,k.toErrorMessage)(N)))}return this.installFromGallery(L)}copyExtension($,R,L,N){return this.extensionsScanner.copyExtension($,R,L,N)}copyExtensions($,R){return this.extensionsScanner.copyExtensions($,R)}markAsUninstalled(...$){return this.extensionsScanner.setUninstalled(...$)}async cleanUp(){this.logService.trace("ExtensionManagementService#cleanUp");try{await this.extensionsScanner.cleanUp()}catch($){this.logService.error($)}}async download($,R,L){const{location:N}=await this.extensionsDownloader.download($,R,!L);return N}async downloadVsix($){if($.scheme===g.Schemas.file)return{location:$,async cleanup(){}};this.logService.trace("Downloading extension from",$.toString());const R=(0,f.joinPath)(this.extensionsDownloader.extensionsDownloadDir,(0,c.generateUuid)());return await this.downloadService.download($,R),this.logService.info("Downloaded extension to",R.toString()),{location:R,cleanup:async()=>{try{await this.fileService.del(R)}catch(N){this.logService.error(N)}}}}getCurrentExtensionsManifestLocation(){return this.userDataProfilesService.defaultProfile.extensionsResource}createInstallExtensionTask($,R,L){if(d.URI.isUri(R))return new oe($,R,L,this.galleryService,this.extensionsScanner,this.uriIdentityService,this.userDataProfilesService,this.extensionsScannerService,this.extensionsProfileScannerService,this.logService);const N=i.ExtensionKey.create(R).toString();let W=this.installGalleryExtensionsTasks.get(N);return W||(this.installGalleryExtensionsTasks.set(N,W=new Z($,R,L,this.extensionsDownloader,this.extensionsScanner,this.uriIdentityService,this.userDataProfilesService,this.extensionsScannerService,this.extensionsProfileScannerService,this.logService)),W.waitUntilTaskIsFinished().finally(()=>this.installGalleryExtensionsTasks.delete(N))),W}createUninstallExtensionTask($,R){return new ue($,R.profileLocation,this.extensionsProfileScannerService)}async collectFiles($){const R=async N=>{let W=await m.Promises.readdir(N);W=W.map(re=>h.join(N,re));const X=await Promise.all(W.map(re=>m.Promises.stat(re)));let ne=Promise.resolve([]);return X.forEach((re,Q)=>{const ee=W[Q];re.isFile()&&(ne=ne.then(ie=>[...ie,ee])),re.isDirectory()&&(ne=ne.then(ie=>R(ee).then(de=>[...ie,...de])))}),ne};return(await R($.location.fsPath)).map(N=>({path:`extension/${h.relative($.location.fsPath,N)}`,localPath:N}))}async onDidChangeExtensionsFromAnotherSource({added:$,removed:R}){if(R)for(const L of R.extensions)this.logService.info("Extensions removed from another source",L.id,R.profileLocation.toString()),this._onDidUninstallExtension.fire({identifier:L,profileLocation:R.profileLocation});if($){const N=(await this.extensionsScanner.scanExtensions(1,$.profileLocation)).filter(W=>$.extensions.some(X=>(0,i.areSameExtensions)(X,W.identifier)));this._onDidInstallExtensions.fire(N.map(W=>(this.logService.info("Extensions added from another source",W.identifier.id,$.profileLocation.toString()),{identifier:W.identifier,local:W,profileLocation:$.profileLocation,operation:1})))}}async watchForExtensionsNotInstalledBySystem(){this._register(this.extensionsScanner.onExtract(R=>this.knownDirectories.add(R)));const $=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation);for(const R of $.children??[])R.isDirectory&&this.knownDirectories.add(R.resource);this._register(this.fileService.watch(this.extensionsScannerService.userExtensionsLocation)),this._register(this.fileService.onDidFilesChange(R=>this.onDidFilesChange(R)))}async onDidFilesChange($){if(!$.affects(this.extensionsScannerService.userExtensionsLocation,1))return;const R=[];for(const L of $.rawAdded){if(this.knownDirectories.has(L)||!this.uriIdentityService.extUri.isEqual(this.uriIdentityService.extUri.dirname(L),this.extensionsScannerService.userExtensionsLocation)||this.uriIdentityService.extUri.isEqual(L,this.uriIdentityService.extUri.joinPath(this.extensionsScannerService.userExtensionsLocation,".obsolete"))||this.uriIdentityService.extUri.basename(L).startsWith(".")||!(await this.fileService.stat(L)).isDirectory)continue;const N=await this.extensionsScanner.scanUserExtensionAtLocation(L);N&&N.installedTimestamp===void 0&&(this.knownDirectories.add(L),R.push(N))}R.length&&(await this.addExtensionsToProfile(R.map(L=>[L,void 0]),this.userDataProfilesService.defaultProfile.extensionsResource),this.logService.info("Added extensions to default profile from external source",R.map(L=>L.identifier.id)))}async addExtensionsToProfile($,R){const L=$.map(N=>N[0]);await this.setInstalled(L),await this.extensionsProfileScannerService.addExtensionsToProfile($,R),this._onDidInstallExtensions.fire(L.map(N=>({local:N,identifier:N.identifier,operation:1,profileLocation:R})))}async setInstalled($){const R=await this.extensionsScanner.getUninstalledExtensions();for(const L of $){const N=i.ExtensionKey.create(L);R[N.toString()]&&(this.logService.trace("Removing the extension from uninstalled list:",N.id),await this.extensionsScanner.setInstalled(N),this.logService.info("Removed the extension from uninstalled list:",N.id))}}};e.ExtensionManagementService=x,e.ExtensionManagementService=x=Ee([G(0,s.IExtensionGalleryService),G(1,H.ITelemetryService),G(2,V.ILogService),G(3,o.INativeEnvironmentService),G(4,a.IExtensionsScannerService),G(5,r.IExtensionsProfileScannerService),G(6,t.IDownloadService),G(7,z.IInstantiationService),G(8,M.IFileService),G(9,J.IProductService),G(10,Y.IUriIdentityService),G(11,B.IUserDataProfilesService)],x);let q=class extends P.Disposable{constructor($,R,L,N,W,X){super(),this.beforeRemovingExtension=$,this.fileService=R,this.extensionsScannerService=L,this.extensionsProfileScannerService=N,this.uriIdentityService=W,this.logService=X,this._onExtract=this._register(new b.Emitter),this.onExtract=this._onExtract.event,this.uninstalledResource=(0,f.joinPath)(this.extensionsScannerService.userExtensionsLocation,".obsolete"),this.uninstalledFileLimiter=new O.Queue}async cleanUp(){await this.removeTemporarilyDeletedFolders(),await this.removeUninstalledExtensions()}async scanExtensions($,R){const L={includeInvalid:!0,profileLocation:R};let N=[];return $===null||$===0?N.push(...await this.extensionsScannerService.scanAllExtensions({includeInvalid:!0},L,!1)):$===1&&N.push(...await this.extensionsScannerService.scanUserExtensions(L)),N=$!==null?N.filter(W=>W.type===$):N,Promise.all(N.map(W=>this.toLocalExtension(W)))}async scanAllUserExtensions($){const R=await this.extensionsScannerService.scanUserExtensions({includeAllVersions:!$,includeInvalid:!0});return Promise.all(R.map(L=>this.toLocalExtension(L)))}async scanUserExtensionAtLocation($){try{const R=await this.extensionsScannerService.scanExistingExtension($,1,{includeInvalid:!0});if(R)return await this.toLocalExtension(R)}catch(R){this.logService.error(R)}return null}async extractUserExtension($,R,L,N,W){const X=$.toString(),ne=d.URI.file(h.join(this.extensionsScannerService.userExtensionsLocation.fsPath,`.${(0,c.generateUuid)()}`)),re=d.URI.file(h.join(this.extensionsScannerService.userExtensionsLocation.fsPath,X));let Q=await this.fileService.exists(re);if(Q&&N){try{await this.deleteExtensionFromLocation($.id,re,"removeExisting")}catch{throw new s.ExtensionManagementError(T.localize(4,null,re.fsPath,$.id),s.ExtensionManagementErrorCode.Delete)}Q=!1}if(!Q)try{try{this.logService.trace(`Started extracting the extension from ${R} to ${re.fsPath}`),await(0,y.extract)(R,ne.fsPath,{sourcePath:"extension",overwrite:!0},W),this.logService.info(`Extracted extension to ${re}:`,$.id)}catch(ee){let ie=s.ExtensionManagementErrorCode.Extract;throw ee instanceof y.ExtractError&&(ee.type==="CorruptZip"?ie=s.ExtensionManagementErrorCode.CorruptZip:ee.type==="Incomplete"&&(ie=s.ExtensionManagementErrorCode.IncompleteZip)),new s.ExtensionManagementError(ee.message,ie)}await this.extensionsScannerService.updateMetadata(ne,L);try{this.logService.trace(`Started renaming the extension from ${ne.fsPath} to ${re.fsPath}`),await this.rename(ne.fsPath,re.fsPath),this.logService.info("Renamed to",re.fsPath)}catch(ee){if(ee.code==="ENOTEMPTY")this.logService.info("Rename failed because extension was installed by another source. So ignoring renaming.",$.id);else throw this.logService.info(`Rename failed because of ${(0,D.getErrorMessage)(ee)}. Deleted from extracted location`,ne),ee}this._onExtract.fire(re)}catch(ee){try{await this.fileService.del(ne,{recursive:!0})}catch{}throw ee}return this.scanLocalExtension(re,1)}async scanMetadata($,R){return R?(await this.getScannedExtension($,R))?.metadata:this.extensionsScannerService.scanMetadata($.location)}async getScannedExtension($,R){return(await this.extensionsProfileScannerService.scanProfileExtensions(R)).find(N=>(0,i.areSameExtensions)(N.identifier,$.identifier))}async updateMetadata($,R,L){return L?await this.extensionsProfileScannerService.updateMetadata([[$,R]],L):await this.extensionsScannerService.updateMetadata($.location,R),this.scanLocalExtension($.location,$.type,L)}getUninstalledExtensions(){return this.withUninstalledExtensions()}async setUninstalled(...$){const R=$.map(L=>i.ExtensionKey.create(L));await this.withUninstalledExtensions(L=>R.forEach(N=>{L[N.toString()]=!0,this.logService.info("Marked extension as uninstalled",N.toString())}))}async setInstalled($){await this.withUninstalledExtensions(R=>delete R[$.toString()])}async removeExtension($,R){if(this.uriIdentityService.extUri.isEqualOrParent($.location,this.extensionsScannerService.userExtensionsLocation))return this.deleteExtensionFromLocation($.identifier.id,$.location,R)}async removeUninstalledExtension($){await this.removeExtension($,"uninstalled"),await this.withUninstalledExtensions(R=>delete R[i.ExtensionKey.create($).toString()])}async copyExtension($,R,L,N){const W=await this.getScannedExtension($,R),X=await this.getScannedExtension($,L);return N={...W?.metadata,...N},X?await this.extensionsProfileScannerService.updateMetadata([[$,{...X.metadata,...N}]],L):await this.extensionsProfileScannerService.addExtensionsToProfile([[$,N]],L),this.scanLocalExtension($.location,$.type,L)}async copyExtensions($,R){const L=await this.scanExtensions(1,$),N=await Promise.all(L.filter(W=>!W.isApplicationScoped).map(async W=>[W,await this.scanMetadata(W,$)]));await this.extensionsProfileScannerService.addExtensionsToProfile(N,R)}async deleteExtensionFromLocation($,R,L){this.logService.trace(`Deleting ${L} extension from disk`,$,R.fsPath);const N=this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(R),`${this.uriIdentityService.extUri.basename(R)}.${(0,S.hash)((0,c.generateUuid)()).toString(16)}${K}`);await this.rename(R.fsPath,N.fsPath),await this.fileService.del(N,{recursive:!0}),this.logService.info(`Deleted ${L} extension from disk`,$,R.fsPath)}async withUninstalledExtensions($){return this.uninstalledFileLimiter.queue(async()=>{let R;try{R=(await this.fileService.readFile(this.uninstalledResource,"utf8")).value.toString()}catch(N){if((0,M.toFileOperationResult)(N)!==1)throw N}let L={};if(R)try{L=JSON.parse(R)}catch{}return $&&($(L),Object.keys(L).length?await this.fileService.writeFile(this.uninstalledResource,A.VSBuffer.fromString(JSON.stringify(L))):await this.fileService.del(this.uninstalledResource)),L})}async rename($,R){try{await m.Promises.rename($,R,2*60*1e3)}catch(L){throw new s.ExtensionManagementError(L.message||T.localize(5,null,$,R),L.code||s.ExtensionManagementErrorCode.Rename)}}async scanLocalExtension($,R,L){if(L){const W=(await this.extensionsScannerService.scanUserExtensions({profileLocation:L})).find(X=>this.uriIdentityService.extUri.isEqual(X.location,$));if(W)return this.toLocalExtension(W)}else{const N=await this.extensionsScannerService.scanExistingExtension($,R,{includeInvalid:!0});if(N)return this.toLocalExtension(N)}throw new Error(T.localize(6,null,$.path))}async toLocalExtension($){const R=await this.fileService.resolve($.location);let L,N;return R.children&&(L=R.children.find(({name:W})=>/^readme(\.txt|\.md|)$/i.test(W))?.resource,N=R.children.find(({name:W})=>/^changelog(\.txt|\.md|)$/i.test(W))?.resource),{identifier:$.identifier,type:$.type,isBuiltin:$.isBuiltin||!!$.metadata?.isBuiltin,location:$.location,manifest:$.manifest,targetPlatform:$.targetPlatform,validations:$.validations,isValid:$.isValid,readmeUrl:L,changelogUrl:N,publisherDisplayName:$.metadata?.publisherDisplayName||null,publisherId:$.metadata?.publisherId||null,isApplicationScoped:!!$.metadata?.isApplicationScoped,isMachineScoped:!!$.metadata?.isMachineScoped,isPreReleaseVersion:!!$.metadata?.isPreReleaseVersion,preRelease:!!$.metadata?.preRelease,installedTimestamp:$.metadata?.installedTimestamp,updated:!!$.metadata?.updated,pinned:!!$.metadata?.pinned}}async removeUninstalledExtensions(){const $=await this.getUninstalledExtensions();if(Object.keys($).length===0){this.logService.debug("No uninstalled extensions found.");return}this.logService.debug("Removing uninstalled extensions:",Object.keys($));const R=await this.extensionsScannerService.scanUserExtensions({includeAllVersions:!0,includeUninstalled:!0,includeInvalid:!0}),L=new Set;for(const W of R)$[i.ExtensionKey.create(W).toString()]||L.add(W.identifier.id.toLowerCase());try{const W=(0,i.groupByExtension)(R,X=>X.identifier);await O.Promises.settled(W.map(async X=>{const ne=X.sort((re,Q)=>w.rcompare(re.manifest.version,Q.manifest.version))[0];L.has(ne.identifier.id.toLowerCase())||await this.beforeRemovingExtension(await this.toLocalExtension(ne))}))}catch(W){this.logService.error(W)}const N=R.filter(W=>W.metadata&&$[i.ExtensionKey.create(W).toString()]);await Promise.allSettled(N.map(W=>this.removeUninstalledExtension(W)))}async removeTemporarilyDeletedFolders(){this.logService.trace("ExtensionManagementService#removeTempDeleteFolders");let $;try{$=await this.fileService.resolve(this.extensionsScannerService.userExtensionsLocation)}catch(R){(0,M.toFileOperationResult)(R)!==1&&this.logService.error(R);return}if($?.children)try{await Promise.allSettled($.children.map(async R=>{if(!(!R.isDirectory||!R.name.endsWith(K))){this.logService.trace("Deleting the temporarily deleted folder",R.resource.toString());try{await this.fileService.del(R.resource,{recursive:!0}),this.logService.trace("Deleted the temporarily deleted folder",R.resource.toString())}catch(L){(0,M.toFileOperationResult)(L)!==1&&this.logService.error(L)}}}))}catch{}}};e.ExtensionsScanner=q,e.ExtensionsScanner=q=Ee([G(1,M.IFileService),G(2,a.IExtensionsScannerService),G(3,r.IExtensionsProfileScannerService),G(4,Y.IUriIdentityService),G(5,V.ILogService)],q);class j extends n.AbstractExtensionTask{get profileLocation(){return this._profileLocation}get verificationStatus(){return this._verificationStatus}get operation(){return(0,l.isUndefined)(this.options.operation)?this._operation:this.options.operation}constructor($,R,L,N,W,X,ne,re,Q){super(),this.identifier=$,this.source=R,this.options=L,this.extensionsScanner=N,this.uriIdentityService=W,this.userDataProfilesService=X,this.extensionsScannerService=ne,this.extensionsProfileScannerService=re,this.logService=Q,this._profileLocation=this.options.profileLocation,this._verificationStatus=!1,this._operation=2}async doRun($){const[R,L]=await this.install($);return this._profileLocation=R.isBuiltin||R.isApplicationScoped?this.userDataProfilesService.defaultProfile.extensionsResource:this.options.profileLocation,this.uriIdentityService.extUri.isEqual(this.userDataProfilesService.defaultProfile.extensionsResource,this._profileLocation)&&await this.extensionsScannerService.initializeDefaultProfileExtensions(),await this.extensionsProfileScannerService.addExtensionsToProfile([[R,L]],this._profileLocation),R}async extractExtension({zipPath:$,key:R,metadata:L},N,W){let X=await this.unsetIfUninstalled(R);return X||(this.logService.trace("Extracting extension...",R.id),X=await this.extensionsScanner.extractUserExtension(R,$,L,N,W),this.logService.info("Extracting extension completed.",R.id)),X}async unsetIfUninstalled($){return await this.isUninstalled($)?(this.logService.trace("Removing the extension from uninstalled list:",$.id),await this.extensionsScanner.setInstalled($),this.logService.info("Removed the extension from uninstalled list:",$.id),(await this.extensionsScanner.scanAllUserExtensions(!0)).find(N=>i.ExtensionKey.create(N).equals($))):void 0}async isUninstalled($){return!!(await this.extensionsScanner.getUninstalledExtensions())[$.toString()]}}class Z extends j{constructor($,R,L,N,W,X,ne,re,Q,ee){super(R.identifier,R,L,W,X,ne,re,Q,ee),this.gallery=R,this.extensionsDownloader=N}async install($){const L=(await this.extensionsScanner.scanExtensions(null,this.options.profileLocation)).find(ne=>(0,i.areSameExtensions)(ne.identifier,this.gallery.identifier));L&&(this._operation=3);const N={id:this.gallery.identifier.uuid,publisherId:this.gallery.publisherId,publisherDisplayName:this.gallery.publisherDisplayName,targetPlatform:this.gallery.properties.targetPlatform,isApplicationScoped:this.options.isApplicationScoped||L?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||L?.isMachineScoped,isBuiltin:this.options.isBuiltin||L?.isBuiltin,isSystem:L?.type===0?!0:void 0,updated:!!L,isPreReleaseVersion:this.gallery.properties.isPreReleaseVersion,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:void 0,preRelease:this.gallery.properties.isPreReleaseVersion||((0,l.isBoolean)(this.options.installPreReleaseVersion)?this.options.installPreReleaseVersion:L?.preRelease)};if(L?.manifest.version===this.gallery.version)return[await this.extensionsScanner.updateMetadata(L,N),N];const{location:W,verificationStatus:X}=await this.extensionsDownloader.download(this.gallery,this._operation,!this.options.donotVerifySignature);try{return this._verificationStatus=X,this.validateManifest(W.fsPath),[await this.extractExtension({zipPath:W.fsPath,key:i.ExtensionKey.create(this.gallery),metadata:N},!1,$),N]}catch(ne){try{await this.extensionsDownloader.delete(W)}catch(re){this.logService.warn("Error while deleting the downloaded file",W.toString(),(0,D.getErrorMessage)(re))}throw ne}}async validateManifest($){try{await(0,u.getManifest)($)}catch(R){throw new s.ExtensionManagementError((0,n.joinErrors)(R).message,s.ExtensionManagementErrorCode.Invalid)}}}e.InstallGalleryExtensionTask=Z;class oe extends j{constructor($,R,L,N,W,X,ne,re,Q,ee){super({id:(0,i.getGalleryExtensionId)($.publisher,$.name)},R,L,W,X,ne,re,Q,ee),this.manifest=$,this.location=R,this.galleryService=N}async doRun($){const R=await super.doRun($);return this.updateMetadata(R,$),R}async install($){const R=new i.ExtensionKey(this.identifier,this.manifest.version),N=(await this.extensionsScanner.scanExtensions(1,this.options.profileLocation)).find(ne=>(0,i.areSameExtensions)(this.identifier,ne.identifier)),W={isApplicationScoped:this.options.isApplicationScoped||N?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||N?.isMachineScoped,isBuiltin:this.options.isBuiltin||N?.isBuiltin,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:void 0};if(N)if(this._operation=3,R.equals(new i.ExtensionKey(N.identifier,N.manifest.version)))try{await this.extensionsScanner.removeExtension(N,"existing")}catch{throw new Error(T.localize(7,null,this.manifest.displayName||this.manifest.name))}else!this.options.profileLocation&&w.gt(N.manifest.version,this.manifest.version)&&await this.extensionsScanner.setUninstalled(N);else{const ne=await this.unsetIfUninstalled(R);if(ne)try{await this.extensionsScanner.removeExtension(ne,"existing")}catch{throw new Error(T.localize(8,null,this.manifest.displayName||this.manifest.name))}}return[await this.extractExtension({zipPath:h.resolve(this.location.fsPath),key:R,metadata:W},!0,$),W]}async updateMetadata($,R){try{let[L]=await this.galleryService.getExtensions([{id:$.identifier.id,version:$.manifest.version}],R);if(L||([L]=await this.galleryService.getExtensions([{id:$.identifier.id}],R)),L){const N={id:L.identifier.uuid,publisherDisplayName:L.publisherDisplayName,publisherId:L.publisherId,isPreReleaseVersion:L.properties.isPreReleaseVersion,preRelease:L.properties.isPreReleaseVersion||this.options.installPreReleaseVersion};await this.extensionsScanner.updateMetadata($,N,this.options.profileLocation)}}catch{}}}class ue extends n.AbstractExtensionTask{constructor($,R,L){super(),this.extension=$,this.profileLocation=R,this.extensionsProfileScannerService=L}async doRun($){await this.extensionsProfileScannerService.removeExtensionFromProfile(this.extension,this.profileLocation)}}}),define(ce[265],le([0,1,2,29,80,222,123,7,19]),function(te,e,I,O,A,_,k,D,b){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionsContributions=void 0;let S=class extends I.Disposable{constructor(p,g,h,f,w,l){super(),p.cleanUp(),(0,_.migrateUnsupportedExtensions)(p,g,h,f,l),A.ExtensionStorageService.removeOutdatedExtensionVersions(p,w)}};e.ExtensionsContributions=S,e.ExtensionsContributions=S=Ee([G(0,k.INativeServerExtensionManagementService),G(1,O.IExtensionGalleryService),G(2,A.IExtensionStorageService),G(3,O.IGlobalExtensionEnablementService),G(4,b.IStorageService),G(5,D.ILogService)],S)}),define(ce[124],le([0,1,68,60,36,275,14,8,3,2,16,6,32,44,64]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.connect=e.serve=e.Server=e.createStaticIPCHandle=e.createRandomIPCHandle=e.XDG_RUNTIME_DIR=e.WebSocketNodeSocket=e.NodeSocket=void 0;class w{traceSocketEvent(u,C){f.SocketDiagnostics.traceSocketEvent(this.socket,this.debugLabel,u,C)}constructor(u,C=""){this._canWrite=!0,this.debugLabel=C,this.socket=u,this.traceSocketEvent("created",{type:"NodeSocket"}),this._errorListener=U=>{if(this.traceSocketEvent("error",{code:U?.code,message:U?.message}),U){if(U.code==="EPIPE")return;(0,D.onUnexpectedError)(U)}},this.socket.on("error",this._errorListener),this._closeListener=U=>{this.traceSocketEvent("close",{hadError:U}),this._canWrite=!1},this.socket.on("close",this._closeListener),this._endListener=()=>{this.traceSocketEvent("nodeEndReceived"),this._canWrite=!1},this.socket.on("end",this._endListener)}dispose(){this.socket.off("error",this._errorListener),this.socket.off("close",this._closeListener),this.socket.off("end",this._endListener),this.socket.destroy()}onData(u){const C=U=>{this.traceSocketEvent("read",U),u(k.VSBuffer.wrap(U))};return this.socket.on("data",C),{dispose:()=>this.socket.off("data",C)}}onClose(u){const C=U=>{u({type:0,hadError:U,error:void 0})};return this.socket.on("close",C),{dispose:()=>this.socket.off("close",C)}}onEnd(u){const C=()=>{u()};return this.socket.on("end",C),{dispose:()=>this.socket.off("end",C)}}write(u){if(!(this.socket.destroyed||!this._canWrite))try{this.traceSocketEvent("write",u),this.socket.write(u.buffer,C=>{if(C){if(C.code==="EPIPE")return;(0,D.onUnexpectedError)(C)}})}catch(C){if(C.code==="EPIPE")return;(0,D.onUnexpectedError)(C)}}end(){this.traceSocketEvent("nodeEndSent"),this.socket.end()}drain(){return this.traceSocketEvent("nodeDrainBegin"),new Promise((u,C)=>{if(this.socket.bufferSize===0){this.traceSocketEvent("nodeDrainEnd"),u();return}const U=()=>{this.socket.off("close",U),this.socket.off("end",U),this.socket.off("error",U),this.socket.off("timeout",U),this.socket.off("drain",U),this.traceSocketEvent("nodeDrainEnd"),u()};this.socket.on("close",U),this.socket.on("end",U),this.socket.on("error",U),this.socket.on("timeout",U),this.socket.on("drain",U)})}}e.NodeSocket=w;var l;(function(v){v[v.MinHeaderByteSize=2]="MinHeaderByteSize",v[v.MaxWebSocketMessageLength=262144]="MaxWebSocketMessageLength"})(l||(l={}));var d;(function(v){v[v.PeekHeader=1]="PeekHeader",v[v.ReadHeader=2]="ReadHeader",v[v.ReadBody=3]="ReadBody",v[v.Fin=4]="Fin"})(d||(d={}));class c extends S.Disposable{get permessageDeflate(){return this._flowManager.permessageDeflate}get recordedInflateBytes(){return this._flowManager.recordedInflateBytes}traceSocketEvent(u,C){this.socket.traceSocketEvent(u,C)}constructor(u,C,U,F){super(),this._onData=this._register(new b.Emitter),this._onClose=this._register(new b.Emitter),this._isEnded=!1,this._state={state:1,readLen:2,fin:0,compressed:!1,firstFrameOfMessage:!0,mask:0},this.socket=u,this.traceSocketEvent("created",{type:"WebSocketNodeSocket",permessageDeflate:C,inflateBytesLength:U?.byteLength||0,recordInflateBytes:F}),this._flowManager=this._register(new m(this,C,U,F,this._onData,(M,z)=>this._write(M,z))),this._register(this._flowManager.onError(M=>{console.error(M),(0,D.onUnexpectedError)(M),this._onClose.fire({type:0,hadError:!0,error:M})})),this._incomingData=new f.ChunkStream,this._register(this.socket.onData(M=>this._acceptChunk(M))),this._register(this.socket.onClose(async M=>{this._flowManager.isProcessingReadQueue()&&await b.Event.toPromise(this._flowManager.onDidFinishProcessingReadQueue),this._onClose.fire(M)}))}dispose(){this._flowManager.isProcessingWriteQueue()?this._register(this._flowManager.onDidFinishProcessingWriteQueue(()=>{this.dispose()})):(this.socket.dispose(),super.dispose())}onData(u){return this._onData.event(u)}onClose(u){return this._onClose.event(u)}onEnd(u){return this.socket.onEnd(u)}write(u){let C=0;for(;C<u.byteLength;)this._flowManager.writeMessage(u.slice(C,Math.min(C+262144,u.byteLength))),C+=262144}_write(u,C){if(this._isEnded)return;this.traceSocketEvent("webSocketNodeSocketWrite",u);let U=2;u.byteLength<126?U+=0:u.byteLength<2**16?U+=2:U+=8;const F=k.VSBuffer.alloc(U);if(C?F.writeUInt8(194,0):F.writeUInt8(130,0),u.byteLength<126)F.writeUInt8(u.byteLength,1);else if(u.byteLength<2**16){F.writeUInt8(126,1);let M=1;F.writeUInt8(u.byteLength>>>8&255,++M),F.writeUInt8(u.byteLength>>>0&255,++M)}else{F.writeUInt8(127,1);let M=1;F.writeUInt8(0,++M),F.writeUInt8(0,++M),F.writeUInt8(0,++M),F.writeUInt8(0,++M),F.writeUInt8(u.byteLength>>>24&255,++M),F.writeUInt8(u.byteLength>>>16&255,++M),F.writeUInt8(u.byteLength>>>8&255,++M),F.writeUInt8(u.byteLength>>>0&255,++M)}this.socket.write(k.VSBuffer.concat([F,u]))}end(){this._isEnded=!0,this.socket.end()}_acceptChunk(u){if(u.byteLength!==0){for(this._incomingData.acceptChunk(u);this._incomingData.byteLength>=this._state.readLen;)if(this._state.state===1){const C=this._incomingData.peek(this._state.readLen),U=C.readUInt8(0),F=(U&128)>>>7,M=(U&64)>>>6,z=C.readUInt8(1),V=(z&128)>>>7,J=z&127;this._state.state=2,this._state.readLen=2+(V?4:0)+(J===126?2:0)+(J===127?8:0),this._state.fin=F,this._state.firstFrameOfMessage&&(this._state.compressed=!!M),this._state.firstFrameOfMessage=!!F,this._state.mask=0,this.traceSocketEvent("webSocketNodeSocketPeekedHeader",{headerSize:this._state.readLen,compressed:this._state.compressed,fin:this._state.fin})}else if(this._state.state===2){const C=this._incomingData.read(this._state.readLen),U=C.readUInt8(1),F=(U&128)>>>7;let M=U&127,z=1;M===126?M=C.readUInt8(++z)*2**8+C.readUInt8(++z):M===127&&(M=C.readUInt8(++z)*0+C.readUInt8(++z)*0+C.readUInt8(++z)*0+C.readUInt8(++z)*0+C.readUInt8(++z)*2**24+C.readUInt8(++z)*2**16+C.readUInt8(++z)*2**8+C.readUInt8(++z));let V=0;F&&(V=C.readUInt8(++z)*2**24+C.readUInt8(++z)*2**16+C.readUInt8(++z)*2**8+C.readUInt8(++z)),this._state.state=3,this._state.readLen=M,this._state.mask=V,this.traceSocketEvent("webSocketNodeSocketPeekedHeader",{bodySize:this._state.readLen,compressed:this._state.compressed,fin:this._state.fin,mask:this._state.mask})}else if(this._state.state===3){const C=this._incomingData.read(this._state.readLen);this.traceSocketEvent("webSocketNodeSocketReadData",C),t(C,this._state.mask),this.traceSocketEvent("webSocketNodeSocketUnmaskedData",C),this._state.state=1,this._state.readLen=2,this._state.mask=0,this._flowManager.acceptFrame(C,this._state.compressed,!!this._state.fin)}}}async drain(){this.traceSocketEvent("webSocketNodeSocketDrainBegin"),this._flowManager.isProcessingWriteQueue()&&await b.Event.toPromise(this._flowManager.onDidFinishProcessingWriteQueue),await this.socket.drain(),this.traceSocketEvent("webSocketNodeSocketDrainEnd")}}e.WebSocketNodeSocket=c;class m extends S.Disposable{get permessageDeflate(){return!!(this._zlibInflateStream&&this._zlibDeflateStream)}get recordedInflateBytes(){return this._zlibInflateStream?this._zlibInflateStream.recordedInflateBytes:k.VSBuffer.alloc(0)}constructor(u,C,U,F,M,z){super(),this._tracer=u,this._onData=M,this._writeFn=z,this._onError=this._register(new b.Emitter),this.onError=this._onError.event,this._writeQueue=[],this._readQueue=[],this._onDidFinishProcessingReadQueue=this._register(new b.Emitter),this.onDidFinishProcessingReadQueue=this._onDidFinishProcessingReadQueue.event,this._onDidFinishProcessingWriteQueue=this._register(new b.Emitter),this.onDidFinishProcessingWriteQueue=this._onDidFinishProcessingWriteQueue.event,this._isProcessingWriteQueue=!1,this._isProcessingReadQueue=!1,C?(this._zlibInflateStream=this._register(new y(this._tracer,F,U,{windowBits:15})),this._zlibDeflateStream=this._register(new T(this._tracer,{windowBits:15})),this._register(this._zlibInflateStream.onError(V=>this._onError.fire(V))),this._register(this._zlibDeflateStream.onError(V=>this._onError.fire(V)))):(this._zlibInflateStream=null,this._zlibDeflateStream=null)}writeMessage(u){this._writeQueue.push(u),this._processWriteQueue()}async _processWriteQueue(){if(!this._isProcessingWriteQueue){for(this._isProcessingWriteQueue=!0;this._writeQueue.length>0;){const u=this._writeQueue.shift();if(this._zlibDeflateStream){const C=await this._deflateMessage(this._zlibDeflateStream,u);this._writeFn(C,!0)}else this._writeFn(u,!1)}this._isProcessingWriteQueue=!1,this._onDidFinishProcessingWriteQueue.fire()}}isProcessingWriteQueue(){return this._isProcessingWriteQueue}_deflateMessage(u,C){return new Promise((U,F)=>{u.write(C),u.flush(M=>U(M))})}acceptFrame(u,C,U){this._readQueue.push({data:u,isCompressed:C,isLastFrameOfMessage:U}),this._processReadQueue()}async _processReadQueue(){if(!this._isProcessingReadQueue){for(this._isProcessingReadQueue=!0;this._readQueue.length>0;){const u=this._readQueue.shift();if(this._zlibInflateStream&&u.isCompressed){const C=await this._inflateFrame(this._zlibInflateStream,u.data,u.isLastFrameOfMessage);this._onData.fire(C)}else this._onData.fire(u.data)}this._isProcessingReadQueue=!1,this._onDidFinishProcessingReadQueue.fire()}}isProcessingReadQueue(){return this._isProcessingReadQueue}_inflateFrame(u,C,U){return new Promise((F,M)=>{u.write(C),U&&u.write(k.VSBuffer.fromByteArray([0,0,255,255])),u.flush(z=>F(z))})}}class y extends S.Disposable{get recordedInflateBytes(){return this._recordInflateBytes?k.VSBuffer.concat(this._recordedInflateBytes):k.VSBuffer.alloc(0)}constructor(u,C,U,F){super(),this._tracer=u,this._recordInflateBytes=C,this._onError=this._register(new b.Emitter),this.onError=this._onError.event,this._recordedInflateBytes=[],this._pendingInflateData=[],this._zlibInflate=(0,_.createInflateRaw)(F),this._zlibInflate.on("error",M=>{this._tracer.traceSocketEvent("zlibInflateError",{message:M?.message,code:M?.code}),this._onError.fire(M)}),this._zlibInflate.on("data",M=>{this._tracer.traceSocketEvent("zlibInflateData",M),this._pendingInflateData.push(k.VSBuffer.wrap(M))}),U&&(this._tracer.traceSocketEvent("zlibInflateInitialWrite",U.buffer),this._zlibInflate.write(U.buffer),this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateInitialFlushFired"),this._pendingInflateData.length=0}))}write(u){this._recordInflateBytes&&this._recordedInflateBytes.push(u.clone()),this._tracer.traceSocketEvent("zlibInflateWrite",u),this._zlibInflate.write(u.buffer)}flush(u){this._zlibInflate.flush(()=>{this._tracer.traceSocketEvent("zlibInflateFlushFired");const C=k.VSBuffer.concat(this._pendingInflateData);this._pendingInflateData.length=0,u(C)})}}class T extends S.Disposable{constructor(u,C){super(),this._tracer=u,this._onError=this._register(new b.Emitter),this.onError=this._onError.event,this._pendingDeflateData=[],this._zlibDeflate=(0,_.createDeflateRaw)({windowBits:15}),this._zlibDeflate.on("error",U=>{this._tracer.traceSocketEvent("zlibDeflateError",{message:U?.message,code:U?.code}),this._onError.fire(U)}),this._zlibDeflate.on("data",U=>{this._tracer.traceSocketEvent("zlibDeflateData",U),this._pendingDeflateData.push(k.VSBuffer.wrap(U))})}write(u){this._tracer.traceSocketEvent("zlibDeflateWrite",u.buffer),this._zlibDeflate.write(u.buffer)}flush(u){this._zlibDeflate.flush(2,()=>{this._tracer.traceSocketEvent("zlibDeflateFlushFired");let C=k.VSBuffer.concat(this._pendingDeflateData);this._pendingDeflateData.length=0,C=C.slice(0,C.byteLength-4),u(C)})}}function t(v,u){if(u===0)return;const C=v.byteLength>>>2;for(let J=0;J<C;J++){const H=v.readUInt32BE(J*4);v.writeUInt32BE(H^u,J*4)}const U=C*4,F=v.byteLength-U,M=u>>>24&255,z=u>>>16&255,V=u>>>8&255;F>=1&&v.writeUInt8(v.readUInt8(U)^M,U),F>=2&&v.writeUInt8(v.readUInt8(U+1)^z,U+1),F>=3&&v.writeUInt8(v.readUInt8(U+2)^V,U+2)}e.XDG_RUNTIME_DIR=process.env.XDG_RUNTIME_DIR;const o={[2]:107,[1]:103};function n(){const v=(0,g.generateUuid)();if(process.platform==="win32")return`\\\\.\\pipe\\vscode-ipc-${v}-sock`;const u=process.platform!=="darwin"&&e.XDG_RUNTIME_DIR?e.XDG_RUNTIME_DIR:(0,A.tmpdir)(),C=(0,P.join)(u,`vscode-ipc-${v}.sock`);return i(C),C}e.createRandomIPCHandle=n;function s(v,u,C){const U=(0,I.createHash)("md5").update(v).digest("hex");if(process.platform==="win32")return`\\\\.\\pipe\\${U}-${C}-${u}-sock`;const F=C.substr(0,4),M=u.substr(0,6),z=U.substr(0,8);let V;return process.platform!=="darwin"&&e.XDG_RUNTIME_DIR&&!process.env.VSCODE_PORTABLE?V=(0,P.join)(e.XDG_RUNTIME_DIR,`vscode-${z}-${F}-${M}.sock`):V=(0,P.join)(v,`${F}-${M}.sock`),i(V),V}e.createStaticIPCHandle=s;function i(v){const u=o[p.platform];typeof u=="number"&&v.length>=u&&console.warn(`WARNING: IPC handle "${v}" is longer than ${u} chars, try a shorter --user-data-dir`)}class r extends h.IPCServer{static toClientConnectionEvent(u){const C=b.Event.fromNodeEventEmitter(u,"connection");return b.Event.map(C,U=>({protocol:new f.Protocol(new w(U,"ipc-server-connection")),onDidClientDisconnect:b.Event.once(b.Event.fromNodeEventEmitter(U,"close"))}))}constructor(u){super(r.toClientConnectionEvent(u)),this.server=u}dispose(){super.dispose(),this.server&&(this.server.close(),this.server=null)}}e.Server=r;function a(v){return new Promise((u,C)=>{const U=(0,O.createServer)();U.on("error",C),U.listen(v,()=>{U.removeListener("error",C),u(new r(U))})})}e.serve=a;function E(v,u){return new Promise((C,U)=>{const F=(0,O.createConnection)(v,()=>{F.removeListener("error",U),C(f.Client.fromSocket(new w(F,`ipc-client${u}`),u))});F.once("error",U)})}e.connect=E}),define(ce[266],le([0,1,60,124,210]),function(te,e,I,O,A){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nodeSocketFactory=void 0,e.nodeSocketFactory=new class{supports(_){return!0}connect({host:_,port:k},D,b,S){return new Promise((P,p)=>{const g=I.createConnection({host:_,port:k},()=>{g.removeListener("error",p),g.write((0,A.makeRawSocketHeaders)(D,b,S));const h=f=>{f.toString().indexOf(`\r
\r
`)>=0&&(g.off("data",h),P(new O.NodeSocket(g,S)))};g.on("data",h)});g.setNoDelay(!0),g.once("error",p)})}}}),define(ce[267],le([0,1,60,36,133,124,5,2,6,18,7,23,213,105,107,76,14]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SharedTunnelsService=e.TunnelService=e.BaseTunnelService=e.NodeRemoteTunnel=void 0;async function d(t,o,n,s,i){let r;for(let a=3;a&&(r?.dispose(),r=await new c(t,o,n,s,i).waitForReady(),!(i&&A.BROWSER_RESTRICTED_PORTS[i]||!A.BROWSER_RESTRICTED_PORTS[r.tunnelLocalPort]));a--);return r}class c extends D.Disposable{constructor(o,n,s,i,r){super(),this.defaultTunnelHost=n,this.suggestedLocalPort=r,this.privacy=w.TunnelPrivacyId.Private,this._socketsDispose=new Map,this._options=o,this._server=I.createServer(),this._barrier=new k.Barrier,this._listeningListener=()=>this._barrier.open(),this._server.on("listening",this._listeningListener),this._connectionListener=a=>this._onConnection(a),this._server.on("connection",this._connectionListener),this._errorListener=()=>{},this._server.on("error",this._errorListener),this.tunnelRemotePort=i,this.tunnelRemoteHost=s}async dispose(){super.dispose(),this._server.removeListener("listening",this._listeningListener),this._server.removeListener("connection",this._connectionListener),this._server.removeListener("error",this._errorListener),this._server.close(),Array.from(this._socketsDispose.values()).forEach(n=>{n()})}async waitForReady(){const o=this.suggestedLocalPort??this.tunnelRemotePort,n=(0,w.isAllInterfaces)(this.defaultTunnelHost)?"0.0.0.0":"127.0.0.1";let s=await(0,A.findFreePortFaster)(o,2,1e3,n),i=null;return this._server.listen(s,this.defaultTunnelHost),await this._barrier.wait(),i=this._server.address(),i||(s=0,this._server.listen(s,this.defaultTunnelHost),await this._barrier.wait(),i=this._server.address()),this.tunnelLocalPort=i.port,this.localAddress=`${this.tunnelRemoteHost==="127.0.0.1"?"127.0.0.1":"localhost"}:${i.port}`,this}async _onConnection(o){o.pause();const n=(0,w.isLocalhost)(this.tunnelRemoteHost)||(0,w.isAllInterfaces)(this.tunnelRemoteHost)?"localhost":this.tunnelRemoteHost,s=await(0,g.connectRemoteAgentTunnel)(this._options,n,this.tunnelRemotePort),i=s.getSocket(),r=s.readEntireBuffer();s.dispose(),r.byteLength>0&&o.write(r.buffer),o.on("end",()=>{o.localAddress&&this._socketsDispose.delete(o.localAddress),i.end()}),o.on("close",()=>i.end()),o.on("error",()=>{o.localAddress&&this._socketsDispose.delete(o.localAddress),i instanceof _.NodeSocket?i.socket.destroy():i.end()}),i instanceof _.NodeSocket?this._mirrorNodeSocket(o,i):this._mirrorGenericSocket(o,i),o.localAddress&&this._socketsDispose.set(o.localAddress,()=>{o.end(),i.end()})}_mirrorGenericSocket(o,n){n.onClose(()=>o.destroy()),n.onEnd(()=>o.end()),n.onData(s=>o.write(s.buffer)),o.on("data",s=>n.write(l.VSBuffer.wrap(s))),o.resume()}_mirrorNodeSocket(o,n){const s=n.socket;s.on("end",()=>o.end()),s.on("close",()=>o.end()),s.on("error",()=>{o.destroy()}),s.pipe(o),o.pipe(s)}}e.NodeRemoteTunnel=c;let m=class extends w.AbstractTunnelService{constructor(o,n,s,i,r){super(n,r),this.remoteSocketFactoryService=o,this.signService=s,this.productService=i}isPortPrivileged(o){return(0,w.isPortPrivileged)(o,this.defaultTunnelHost,b.OS,O.release())}retainOrCreateTunnel(o,n,s,i,r,a,E,v){const u=this.getTunnelFromMap(n,s);if(u)return++u.refcount,u.value;if((0,w.isTunnelProvider)(o))return this.createWithProvider(o,n,s,r,a,E,v);{this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel without provider ${n}:${s} on local port ${r}.`);const C={commit:this.productService.commit,quality:this.productService.quality,addressProvider:o,remoteSocketFactoryService:this.remoteSocketFactoryService,signService:this.signService,logService:this.logService,ipcLogger:null},U=d(C,i,n,s,r);return this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created without provider."),this.addTunnelToMap(n,s,U),U}}};e.BaseTunnelService=m,e.BaseTunnelService=m=Ee([G(0,h.IRemoteSocketFactoryService),G(1,P.ILogService),G(2,f.ISignService),G(3,p.IProductService),G(4,S.IConfigurationService)],m);let y=class extends m{constructor(o,n,s,i,r){super(o,n,s,i,r)}};e.TunnelService=y,e.TunnelService=y=Ee([G(0,h.IRemoteSocketFactoryService),G(1,P.ILogService),G(2,f.ISignService),G(3,p.IProductService),G(4,S.IConfigurationService)],y);let T=class extends D.Disposable{constructor(o,n,s,i,r){super(),this.remoteSocketFactoryService=o,this.logService=n,this.productService=s,this.signService=i,this.configurationService=r,this._tunnelServices=new Map}async openTunnel(o,n,s,i,r,a,E,v,u){if(this.logService.trace(`ForwardedPorts: (SharedTunnelService) openTunnel request for ${s}:${i} on local port ${a}.`),!this._tunnelServices.has(o)){const C=new y(this.remoteSocketFactoryService,this.logService,this.signService,this.productService,this.configurationService);this._register(C),this._tunnelServices.set(o,C),C.onTunnelClosed(async()=>{(await C.tunnels).length===0&&(C.dispose(),this._tunnelServices.delete(o))})}return this._tunnelServices.get(o).openTunnel(n,s,i,r,a,E,v,u)}};e.SharedTunnelsService=T,e.SharedTunnelsService=T=Ee([G(0,h.IRemoteSocketFactoryService),G(1,P.ILogService),G(2,p.IProductService),G(3,f.ISignService),G(4,S.IConfigurationService)],T)}),define(ce[276],le([0,1,36,38,8,2,26,11,20,3,44,147,204,205,196,197,262,187,189,18,209,97,220,98,215,15,115,247,29,99,188,123,100,13,199,200,67,4,195,69,71,225,7,201,72,23,57,19,108,21,109,110,111,46,228,80,112,24,78,253,238,239,81,254,257,258,259,58,252,241,107,219,76,267,214,229,27,230,6,231,190,207,206,79,246,17,50,203,56,251,227,242,106,256,265,9,202,103,249,245,216,184,55,260,248,70,250,105,266,182,113,240,217]),function(te,e,I,O,A,_,k,D,b,S,P,p,g,h,f,w,l,d,c,m,y,T,t,o,n,s,i,r,a,E,v,u,C,U,F,M,z,V,J,H,Y,B,K,x,q,j,Z,oe,ue,ae,$,R,L,N,W,X,ne,re,Q,ee,ie,de,fe,pe,ye,De,ke,Ue,he,me,Se,Ie,Le,$e,_e,ze,Oe,Me,se,ge,ve,we,Pe,be,Re,Te,Ae,Ne,We,je,qe,Je,Qe,Et,wt,Ct,bt,ht,Pt,It,Dt,Rt,Lt,kt,Tt,dt,_t,ft,At,Ut,gt,Ot,it){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.main=void 0;class Nt extends _.Disposable{constructor(Ce){super(),this.configuration=Ce,this.server=this._register(new p.Server(this)),this.lifecycleService=void 0,this.onDidWindowConnectRaw=this._register(new S.Emitter),this.registerListeners()}registerListeners(){let Ce=!1;const Fe=()=>{Ce||(Ce=!0,this.lifecycleService?.fireOnWillShutdown(),this.dispose())};process.once("exit",Fe),(0,p.once)(process.parentPort,it.SharedProcessLifecycle.exit,Fe)}async init(){const Ce=await this.initServices();(0,re.registerConfiguration)(),Ce.invokeFunction(Fe=>{const Ge=Fe.get(K.ILogService);Ge.trace("sharedProcess configuration",JSON.stringify(this.configuration)),this.initChannels(Fe),this.registerErrorHandler(Ge)}),this._register((0,_.combinedDisposable)(Ce.createInstance(g.CodeCacheCleaner,this.configuration.codeCachePath),Ce.createInstance(h.LanguagePackCachedDataCleaner),Ce.createInstance(l.UnusedWorkspaceStorageDataCleaner),Ce.createInstance(w.LogsDataCleaner),Ce.createInstance(f.LocalizationsUpdater),Ce.createInstance(wt.ExtensionsContributions),Ce.createInstance(Je.UserDataProfilesCleaner),Ce.createInstance(Ot.VoiceTranscriptionManager,this.onDidWindowConnectRaw.event)))}async initServices(){const Ce=new H.ServiceCollection,Fe={_serviceBrand:void 0,...q.default};Ce.set(j.IProductService,Fe);const Ge=new P.StaticRouter(Ve=>Ve==="main"),xe=new dt.MainProcessService(this.server,Ge);Ce.set(dt.IMainProcessService,xe);const st=this.configuration.policiesData?new Ne.PolicyChannelClient(this.configuration.policiesData,xe.getChannel("policy")):new We.NullPolicyService;Ce.set(We.IPolicyService,st);const Be=new Ut.NativeEnvironmentService(this.configuration.args,Fe);Ce.set(s.INativeEnvironmentService,Be);const Xe=new x.LoggerChannelClient(void 0,this.configuration.logLevel,Be.logsHome,this.configuration.loggers.map(Ve=>({...Ve,resource:D.URI.revive(Ve.resource)})),xe.getChannel("logger"));Ce.set(K.ILoggerService,Xe);const rt=this._register(Xe.createLogger("sharedprocess",{name:(0,Ct.localize)(0,null)})),ct=this._register(new K.ConsoleLogger(rt.getLevel())),He=this._register(new bt.LogService(rt,[ct]));Ce.set(K.ILogService,He),this.lifecycleService=this._register(new ht.SharedProcessLifecycleService(He)),Ce.set(ht.ISharedProcessLifecycleService,this.lifecycleService);const Ke=this._register(new F.FileService(He));Ce.set(U.IFileService,Ke);const lt=this._register(new M.DiskFileSystemProvider(He));Ke.registerProvider(k.Schemas.file,lt);const ut=this._register(new ge.FileUserDataProvider(k.Schemas.file,this._register(new ve.DiskFileSystemProviderClient(xe.getChannel(ve.LOCAL_FILE_SYSTEM_CHANNEL_NAME),{pathCaseSensitive:se.isLinux})),k.Schemas.vscodeUserData,He));Ke.registerProvider(k.Schemas.vscodeUserData,ut);const Ze=this._register(new je.UserDataProfilesService(this.configuration.profiles.all,D.URI.revive(this.configuration.profiles.home).with({scheme:Be.userRoamingDataHome.scheme}),xe.getChannel("userDataProfiles")));Ce.set(Te.IUserDataProfilesService,Ze);const Ye=this._register(new y.ConfigurationService(Ze.defaultProfile.settingsResource,Ke,st,He));Ce.set(m.IConfigurationService,Ye);const et=new _t.RemoteStorageService(void 0,{defaultProfile:Ze.defaultProfile,currentProfile:Ze.defaultProfile},xe,Be);Ce.set(oe.IStorageService,et),this._register((0,_.toDisposable)(()=>et.flush())),await Promise.all([Ye.initialize(),et.initialize()]);const Ft=new Me.UriIdentityService(Ke);Ce.set(Oe.IUriIdentityService,Ft);const St=new Dt.RequestChannelClient(xe.getChannel("request"));Ce.set(Z.IRequestService,St),Ce.set(d.IChecksumService,new z.SyncDescriptor(c.ChecksumService,void 0,!1)),Ce.set(Pe.IV8InspectProfilingService,new z.SyncDescriptor(we.InspectProfilingService,void 0,!1));const vt=P.ProxyChannel.toService(xe.getChannel("nativeHost"));Ce.set(Lt.INativeHostService,vt),Ce.set(o.IDownloadService,new z.SyncDescriptor(n.DownloadService,void 0,!0));const Mt=this._register(new me.ActiveWindowManager(vt)),$t=new P.StaticRouter(Ve=>Mt.getActiveClientId().then(at=>Ve===at));Ce.set(C.IExtensionRecommendationNotificationService,new Rt.ExtensionRecommendationNotificationServiceChannelClient(this.server.getChannel("extensionRecommendationNotification",$t)));let ot;const tt=[],pt=(0,N.isInternalTelemetry)(Fe,Ye);if((0,N.supportsTelemetry)(Fe,Be)){const Ve=new R.TelemetryLogAppender(He,Xe,Be,Fe);if(tt.push(Ve),Fe.aiConfig?.ariaKey){const at=new qe.OneDataSystemAppender(St,pt,"adsworkbench",null,Fe.aiConfig.ariaKey);this._register((0,_.toDisposable)(()=>at.flush())),tt.push(at)}ot=new L.TelemetryService({appenders:tt,commonProperties:(0,ue.resolveCommonProperties)((0,I.release)(),(0,I.hostname)(),process.arch,Fe.commit,Fe.version,this.configuration.machineId,pt),sendErrorTelemetry:!0,piiPaths:(0,N.getPiiPathsFromEnvironment)(Be)},Ye,Fe)}else{ot=N.NullTelemetryService;const Ve=N.NullAppender;tt.push(Ve)}this.server.registerChannel("telemetryAppender",new $.TelemetryAppenderChannel(tt)),Ce.set(ae.ITelemetryService,ot);const Wt=new W.CustomEndpointTelemetryService(Ye,ot,He,Xe,Be,Fe);Ce.set(ae.ICustomEndpointTelemetryService,Wt),Ce.set(Ae.IExtensionsProfileScannerService,new z.SyncDescriptor(It.ExtensionsProfileScannerService,void 0,!0)),Ce.set(be.IExtensionsScannerService,new z.SyncDescriptor(Re.ExtensionsScannerService,void 0,!0)),Ce.set(E.IExtensionSignatureVerificationService,new z.SyncDescriptor(E.ExtensionSignatureVerificationService,void 0,!0)),Ce.set(u.INativeServerExtensionManagementService,new z.SyncDescriptor(u.ExtensionManagementService,void 0,!0)),Ce.set(a.IExtensionGalleryService,new z.SyncDescriptor(r.ExtensionGalleryService,void 0,!0)),Ce.set(a.IExtensionTipsService,new z.SyncDescriptor(Tt.ExtensionTipsService,void 0,!1)),Ce.set(Y.ILanguagePackService,new z.SyncDescriptor(B.NativeLanguagePackService,void 0,!1)),Ce.set(T.IDiagnosticsService,new z.SyncDescriptor(t.DiagnosticsService,void 0,!1)),Ce.set(Q.IUserDataSyncAccountService,new z.SyncDescriptor(Q.UserDataSyncAccountService,void 0,!0)),Ce.set(re.IUserDataSyncLogService,new z.SyncDescriptor(de.UserDataSyncLogService,void 0,!0)),Ce.set(re.IUserDataSyncUtilService,new ie.UserDataSyncUtilServiceClient(this.server.getChannel("userDataSyncUtil",Ve=>Ve.ctx!=="main"))),Ce.set(a.IGlobalExtensionEnablementService,new z.SyncDescriptor(i.GlobalExtensionEnablementService,void 0,!1)),Ce.set(ne.IIgnoredExtensionsManagementService,new z.SyncDescriptor(ne.IgnoredExtensionsManagementService,void 0,!0)),Ce.set(X.IExtensionStorageService,new z.SyncDescriptor(X.ExtensionStorageService)),Ce.set(re.IUserDataSyncStoreManagementService,new z.SyncDescriptor(ke.UserDataSyncStoreManagementService,void 0,!0)),Ce.set(re.IUserDataSyncStoreService,new z.SyncDescriptor(ke.UserDataSyncStoreService,void 0,!0)),Ce.set(fe.IUserDataSyncMachinesService,new z.SyncDescriptor(fe.UserDataSyncMachinesService,void 0,!0)),Ce.set(re.IUserDataSyncBackupStoreService,new z.SyncDescriptor(ee.UserDataSyncBackupStoreService,void 0,!1)),Ce.set(re.IUserDataSyncEnablementService,new z.SyncDescriptor(pe.UserDataSyncEnablementService,void 0,!0)),Ce.set(re.IUserDataSyncService,new z.SyncDescriptor(ye.UserDataSyncService,void 0,!1)),Ce.set(Ue.IUserDataProfileStorageService,new z.SyncDescriptor(he.NativeUserDataProfileStorageService,void 0,!0)),Ce.set(re.IUserDataSyncResourceProviderService,new z.SyncDescriptor(Et.UserDataSyncResourceProviderService,void 0,!0)),Ce.set(Se.ISignService,new z.SyncDescriptor(Ie.SignService,void 0,!1));const yt=new ft.RemoteSocketFactoryService;return Ce.set(ft.IRemoteSocketFactoryService,yt),yt.register(0,At.nodeSocketFactory),Ce.set(Le.ISharedTunnelsService,new z.SyncDescriptor($e.SharedTunnelsService)),Ce.set(_e.ISharedProcessTunnelService,new z.SyncDescriptor(ze.SharedProcessTunnelService)),Ce.set(Qe.IRemoteTunnelService,new z.SyncDescriptor(Pt.RemoteTunnelService)),Ce.set(gt.IVoiceRecognitionService,new z.SyncDescriptor(gt.VoiceRecognitionService)),new J.InstantiationService(Ce)}initChannels(Ce){const Fe=new v.ExtensionManagementChannel(Ce.get(a.IExtensionManagementService),()=>null);this.server.registerChannel("extensions",Fe);const Ge=P.ProxyChannel.fromService(Ce.get(Y.ILanguagePackService));this.server.registerChannel("languagePacks",Ge);const xe=P.ProxyChannel.fromService(Ce.get(T.IDiagnosticsService));this.server.registerChannel("diagnostics",xe);const st=new v.ExtensionTipsChannel(Ce.get(a.IExtensionTipsService));this.server.registerChannel("extensionTipsService",st);const Be=P.ProxyChannel.fromService(Ce.get(d.IChecksumService));this.server.registerChannel("checksum",Be);const Xe=P.ProxyChannel.fromService(Ce.get(Pe.IV8InspectProfilingService));this.server.registerChannel("v8InspectProfiling",Xe);const rt=new ie.UserDataSyncMachinesServiceChannel(Ce.get(fe.IUserDataSyncMachinesService));this.server.registerChannel("userDataSyncMachines",rt);const ct=P.ProxyChannel.fromService(Ce.get(ae.ICustomEndpointTelemetryService));this.server.registerChannel("customEndpointTelemetry",ct);const He=new ie.UserDataSyncAccountServiceChannel(Ce.get(Q.IUserDataSyncAccountService));this.server.registerChannel("userDataSyncAccount",He);const Ke=new ie.UserDataSyncStoreManagementServiceChannel(Ce.get(re.IUserDataSyncStoreManagementService));this.server.registerChannel("userDataSyncStoreManagement",Ke);const lt=new De.UserDataSyncChannel(Ce.get(re.IUserDataSyncService),Ce.get(Te.IUserDataProfilesService),Ce.get(K.ILogService));this.server.registerChannel("userDataSync",lt);const ut=this._register(Ce.get(V.IInstantiationService).createInstance(kt.UserDataAutoSyncService)),Ze=new ie.UserDataAutoSyncChannel(ut);this.server.registerChannel("userDataAutoSync",Ze);const Ye=P.ProxyChannel.fromService(Ce.get(_e.ISharedProcessTunnelService));this.server.registerChannel(_e.ipcSharedProcessTunnelChannelName,Ye);const et=P.ProxyChannel.fromService(Ce.get(Qe.IRemoteTunnelService));this.server.registerChannel("remoteTunnel",et)}registerErrorHandler(Ce){process.on("uncaughtException",Fe=>(0,A.onUnexpectedError)(Fe)),process.on("unhandledRejection",Fe=>(0,A.onUnexpectedError)(Fe)),(0,A.setUnexpectedErrorHandler)(Fe=>{const Ge=(0,O.toErrorMessage)(Fe,!0);Ge&&Ce.error(`[uncaught exception in sharedProcess]: ${Ge}`)})}handledClientConnection(Ce){if(Ce.data!==it.SharedProcessRawConnection.response)return!1;const Fe=(0,b.firstOrDefault)(Ce.ports);return Fe?(this.onDidWindowConnectRaw.fire(Fe),!0):!1}}async function mt(nt){const Ce=new Nt(nt);process.parentPort.postMessage(it.SharedProcessLifecycle.ipcReady),await Ce.init(),process.parentPort.postMessage(it.SharedProcessLifecycle.initDone)}e.main=mt,process.parentPort.once("message",nt=>{mt(nt.data)})})}).call(this);

//# sourceMappingURL=https://sqlopsbuilds.blob.core.windows.net/sourcemaps/b6f7beb01f92adaa4b79b6b6f3ac704e95cafe6e/core/vs/code/node/sharedProcess/sharedProcessMain.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit