PageSourceSearch

https://fe-static-yuketang.yuketang.cn/fe/static/web/1.2.315/js/11598.708d4f03.js

js yuketang.cn collected 2026-09-28 09:24:17 UTC 9,596 bytes, 21 lines download raw bytes

1"use strict";(self.webpackChunkrainweb=self.webpackChunkrainweb||[]).push([["11598"],{49262:function(t,e,l){l.r(e),l.d(e,{default:function(){return r}});let i="polystar",o=async function(t){let e,l=t.configObj.pref("lang");try{e=await function(t){switch(t){case"./locale/en.js":return Promise.resolve().then(function(){return s});case"./locale/fr.js":return Promise.resolve().then(function(){return n});case"./locale/sv.js":return Promise.resolve().then(function(){return a});case"./locale/tr.js":return Promise.resolve().then(function(){return u});case"./locale/uk.js":return Promise.resolve().then(function(){return d});case"./locale/zh-CN.js":return Promise.resolve().then(function(){return b});default:return new Promise(function(e,l){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(l.bind(null,Error("Unknown variable dynamic import: "+t)))})}}(`./locale/${l}.js`)}catch(t){console.warn(`Missing translation (${l}) for ${i} - using 'en'`),e=await Promise.resolve().then(function(){return s})}t.i18next.addResourceBundle(l,i,e.default)};var r={name:i,async init(){let t,e,l,{svgCanvas:r}=this,{ChangeElementCommand:s}=r.history,n=t=>{r.undoMgr.addCommandToHistory(t)},{$id:a,$click:u}=r;await o(this);let d=(t,e)=>{t?a(`${e}_panel`).style.removeProperty("display"):a(`${e}_panel`).style.display="none"},b=(e,l)=>{r.changeSelectedAttribute(e,l),r.call("changed",t)},g=t=>1/Math.tan(t),p=t=>1/Math.cos(t);return{name:this.i18next.t(`${i}:name`),callback(){let e=`
2            <se-flyingbutton id="tools_polygon" title="${i}:title">
3              <se-button id="tool_star" title="${i}:buttons.0.title" src="star.svg">
4              </se-button>
5              <se-button id="tool_polygon" title="${i}:buttons.1.title" src="polygon.svg">
6              </se-button>
7            </se-flyingbutton>
8          `;r.insertChildAtIndex(a("tools_left"),e,10),u(a("tool_star"),()=>{this.leftPanel.updateLeftPanel("tool_star")&&(r.setMode("star"),d(!0,"star"),d(!1,"polygon"))}),u(a("tool_polygon"),()=>{this.leftPanel.updateLeftPanel("tool_polygon")&&(r.setMode("polygon"),d(!0,"polygon"),d(!1,"star"))});let l=`${i}:contextTools.0.label`,o=`${i}:contextTools.0.title`,c=`${i}:contextTools.1.label`,h=`${i}:contextTools.1.title`,f=`${i}:contextTools.2.label`,m=`${i}:contextTools.2.title`,y=`${i}:contextTools.3.label`,M=`${i}:contextTools.3.title`,A=document.createElement("template");A.innerHTML=`
9          <div id="star_panel">
10            <se-spin-input id="starNumPoints" label="${l}" min=1 step=1 value=5 title="${o}">
11            </se-spin-input>
12            <se-spin-input id="RadiusMultiplier" label="${c}" min=1 step=2.5 value=3 title="${h}">
13            </se-spin-input>
14            <se-spin-input id="radialShift" min=0 step=1 value=0 label="${f}" title="${m}">
15            </se-spin-input>
16          </div>
17          <div id="polygon_panel">
18            <se-spin-input size="3" id="polySides" min=1 step=1 value=5 label="${y}" title="${M}">
19            </se-spin-input>
20          </div>
21        `,a("tools_top").appendChild(A.content.cloneNode(!0)),d(!1,"star"),d(!1,"polygon"),a("starNumPoints").addEventListener("change",e=>{b("point",e.target.value);let l=e.target.value,i=t.length;for(;i--;){let e=t[i];if(e.hasAttribute("r")){let t=e.getAttribute("point"),i=e.getAttribute("points"),o=e.getAttribute("radialshift"),r=0,a=0;if(e.points){let u=e.points,d=u.numberOfItems;for(let t=0;t<d;++t){let e=u.getItem(t);r+=parseFloat(e.x),a+=parseFloat(e.y)}let b=r/d,g=a/d,p=Number(e.getAttribute("r")),c=p/e.getAttribute("starRadiusMultiplier"),h="";for(let t=0;l>=t;t++){let e=2*Math.PI*(t/l),i=p*Math.cos(e-=Math.PI/2)+b,r=p*Math.sin(e)+g;h+=i+","+r+" ",isNaN(c)||(h+=(i=c*Math.cos(e=2*Math.PI*(t/l)+Math.PI/l-Math.PI/2+o)+b)+","+(r=c*Math.sin(e)+g)+" ")}e.setAttribute("points",h),n(new s(e,{point:t,points:i}))}}}}),a("RadiusMultiplier").addEventListener("change",t=>{b("starRadiusMultiplier",t.target.value)}),a("radialShift").addEventListener("change",t=>{b("radialshift",t.target.value)}),a("polySides").addEventListener("change",e=>{b("sides",e.target.value);let l=e.target.value,i=t.length;for(;i--;){let e=t[i];if(e.hasAttribute("edge")){let t=e.getAttribute("sides"),i=e.getAttribute("points"),o=0,r=0;if(e.points){let a=e.points,u=a.numberOfItems;for(let t=0;t<u;++t){let e=a.getItem(t);o+=parseFloat(e.x),r+=parseFloat(e.y)}let d=o/u,b=r/u,c=e.getAttribute("edge")/2*g(Math.PI/l)*p(Math.PI/l),h="";for(let t=0;l>=t;t++){let e=2*Math.PI*t/l;h+=c*Math.cos(e)+d+","+(c*Math.sin(e)+b)+" "}e.setAttribute("points",h),n(new s(e,{sides:t,points:i}))}}}})},mouseDown(t){if("star"===r.getMode()){let i=r.getColor("fill"),o=r.getColor("stroke"),s=r.getStrokeWidth();return e=!0,l=r.addSVGElementsFromJson({element:"polygon",attr:{cx:t.start_x,cy:t.start_y,id:r.getNextId(),shape:"star",point:a("starNumPoints").value,r:0,radialshift:a("radialShift").value,r2:0,orient:"point",fill:i,stroke:o,"stroke-width":s}}),{started:!0}}if("polygon"===r.getMode()){let i=r.getColor("fill"),o=r.getColor("stroke"),s=r.getStrokeWidth();return e=!0,l=r.addSVGElementsFromJson({element:"polygon",attr:{cx:t.start_x,cy:t.start_y,id:r.getNextId(),shape:"regularPoly",sides:a("polySides").value,orient:"x",edge:0,fill:i,stroke:o,"stroke-width":s}}),{started:!0}}},mouseMove(t){if(e){if("star"===r.getMode()){let e=Number(l.getAttribute("cx")),i=Number(l.getAttribute("cy")),o=Number(l.getAttribute("point")),r=l.getAttribute("orient"),s=l.getAttribute("fill"),n=l.getAttribute("stroke"),a=Number(l.getAttribute("stroke-width")),u=Number(l.getAttribute("radialshift")),d=t.mouse_x,b=t.mouse_y,g=Math.sqrt((d-e)*(d-e)+(b-i)*(b-i))/1.5,p=document.getElementById("RadiusMultiplier").value,c=g/p;l.setAttribute("r",g),l.setAttribute("r2",c),l.setAttribute("starRadiusMultiplier",p);let h="";for(let t=0;o>=t;t++){let l=2*Math.PI*(t/o);"point"===r?l-=Math.PI/2:"edge"===r&&(l=l+Math.PI/o-Math.PI/2),h+=(d=g*Math.cos(l)+e)+","+(b=g*Math.sin(l)+i)+" ",isNaN(c)||(l=2*Math.PI*(t/o)+Math.PI/o,"point"===r?l-=Math.PI/2:"edge"===r&&(l=l+Math.PI/o-Math.PI/2),l+=u,h+=(d=c*Math.cos(l)+e)+","+(b=c*Math.sin(l)+i)+" ")}return l.setAttribute("points",h),l.setAttribute("fill",s),l.setAttribute("stroke",n),l.setAttribute("stroke-width",a),l.getAttribute("shape"),{started:!0}}if("polygon"===r.getMode()){let e=Number(l.getAttribute("cx")),i=Number(l.getAttribute("cy")),o=Number(l.getAttribute("sides")),r=l.getAttribute("fill"),s=l.getAttribute("stroke"),n=Number(l.getAttribute("stroke-width")),a=t.mouse_x,u=t.mouse_y,d=Math.sqrt((a-e)*(a-e)+(u-i)*(u-i))/1.5;l.setAttribute("edge",d);let b=d/2*g(Math.PI/o)*p(Math.PI/o),c="";for(let t=0;o>=t;t++){let l=2*Math.PI*t/o;c+=(a=b*Math.cos(l)+e)+","+(u=b*Math.sin(l)+i)+" "}return l.setAttribute("points",c),l.setAttribute("fill",r),l.setAttribute("stroke",s),l.setAttribute("stroke-width",n),{started:!0}}}},mouseUp:()=>"star"===r.getMode()?{keep:"0"!==l.getAttribute("r"),element:l}:"polygon"===r.getMode()?{keep:"0"!==l.getAttribute("edge"),element:l}:void 0,selectedChanged(e){let l=(t=e.elems).length;if(!l)return d(!1,"star"),void d(!1,"polygon");for(;l--;){let i=t[l];"star"===i?.getAttribute("shape")?e.selectedElement&&!e.multiselected?(a("starNumPoints").value=i.getAttribute("point"),a("radialShift").value=i.getAttribute("radialshift"),d(!0,"star")):d(!1,"star"):"regularPoly"===i?.getAttribute("shape")?e.selectedElement&&!e.multiselected?(a("polySides").value=i.getAttribute("sides"),d(!0,"polygon")):d(!1,"polygon"):(d(!1,"star"),d(!1,"polygon"))}}}}},s=Object.freeze({__proto__:null,default:{name:"star",title:"Polygone/Star Tool",buttons:[{title:"Star Tool"},{title:"Polygon Tool"}
21],contextTools:[{title:"Number of Sides",label:"points"},{title:"Pointiness",label:"Pointiness"},{title:"Twists the star",label:"Radial Shift"},{title:"Number of Sides",label:"sides"}]}}),n=Object.freeze({__proto__:null,default:{name:"etoile",title:"Outil Polygone/Etoile",buttons:[{title:"Outil Etoile"},{title:"Outil Polygone"}],contextTools:[{title:"Nombre de c\xf4t\xe9s",label:"points"},{title:"Pr\xe9cision",label:"Pr\xe9cision"},{title:"Torsion Etoile",label:"D\xe9calage Radial"},{title:"Nombre de c\xf4t\xe9s",label:"c\xf4t\xe9s"}]}}),a=Object.freeze({__proto__:null,default:{name:"stj\xe4rna",title:"Polygon/stj\xe4rnverktyg",buttons:[{title:"Stj\xe4rnverktyg"},{title:"Polygonverktyg"}],contextTools:[{title:"Antal sidor",label:"po\xe4ng"},{title:"Pointiness",label:"Pointiness"},{title:"Vrider stj\xe4rnan",label:"Radiell f\xf6rskjutning"},{title:"Antal sidor",label:"sidor"}]}}),u=Object.freeze({__proto__:null,default:{name:"yıldız",title:"\xc7okgen/Yıldız Aracı",buttons:[{title:"Yıldız Aracı"},{title:"\xc7okgen Aracı"}],contextTools:[{title:"Kenar Sayısı",label:"noktalar"},{title:"Sivrilik",label:"Sivrilik"},{title:"Yıldızı Kıvır",label:"D\xf6ng\xfcsel Kaydırma"},{title:"Kenar Sayısı",label:"kenarlar"}]}}),d=Object.freeze({__proto__:null,default:{name:"зірка",title:"Полігон/Зірка",buttons:[{title:"Зірка"},{title:"Полігон"}],contextTools:[{title:"Кількість Сторін",label:"точки"},{title:"Без точок",label:"Без точок"},{title:"Закручення зірки",label:"Радіальне Зміщення"},{title:"Кількість Сторін",label:"сторони"}]}}),b=Object.freeze({__proto__:null,default:{name:"星形",title:"Polygone/Star Tool",buttons:[{title:"星形工具"},{title:"多边形工具"}],contextTools:[{title:"顶点",label:"顶点"},{title:"钝度",label:"钝度"},{title:"径向",label:"径向"},{title:"边数",label:"边数"}]}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.